The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch...
Besides Plotting graphs in Ruby with Gruff, which comes handy for many uses cases, you sometimes might need configuration for more advanced plots, e.g. for academic concerns. Then using Gnuplot...
...where each array holds the data for x-, y- or z-axis. The major benefit of numo-gnuplot is that it supports advanced numpy like array operations, like multi array...
TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...
If you ever need to restore exact records from one database to another, Marshal might come in handy. Marshal.dump is...
The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...
SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However...
When HTTP clients make an request they can define which response formats they can process. They do it by adding...
This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...
There is a common view that extracting text from a PDF document should not be too difficult. After all, the...
There is no one-liner in Ruby or ActiveSupport with the behavior described above. There have been discussions about adding a method like Enumerable#find_map:
RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...
...follow redirects to get the desired response. This is supported but not the default behavior. You can do so by using the .follow method. This follows redirects for the following...
...Rails has a method ActiveRecord::Relation#merge that can merge ActiveRecord scopes. However, its behavior has never been clear, and in Rails 7 it still discards conditions on the same...
...column by the last condition. We discourage using #merge!) The best way to merge ActiveRecord scopes is using a subquery: scope_a.where(id: scope_b) It is a little less concise...
...not scale the icon with the font size. One option that seems to work better is to use the mask CSS feature. The idea is to have an element with...
...var(--icon-url) center / contain no-repeat // this can probably be done in a better way: vertical-align: text-bottom margin-bottom: -.1em // depends on the icons @each $icon in...
When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:
When giving a presentation where you do some coding, the font size you usually use is probably a bit too...
...often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs desktop navigation menus). Since you want your integration tests to behave...
...metrics". This allows you to configure dimensions larger than your display and enable/disable touch behavior. Simply use register_driver to set up a driver that you then connect to Capybara...
...find(..., visible: true) or find(..., visible: :visible). Note that you could change the default behavior by setting the ignore_hidden_elements config option. However, ignoring invisible elements is a useful...
When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name' with t('.name_prompt'). You...
Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...
In the discussion of the difference between include and extend in Ruby, there is a misconception that extend would add...
We're always striving towards keeping our website's JavaScript as small as possible. If you're using webpack(er...
While both the alt attribute and the figcaption element provide a way to describe images, the way we write for...
A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...