git --fixup is very handy to amend a change to a previous commit. You can then autosquash your commits with...
We are using Spring in our tests for sequential test execution but not for parallel test execution. And Rails requires...
It is generally discouraged to load your JavaScript by a tag in the : The reason is that a tag will pause the DOM parser until the script has loaded and executed. This will delay the browser's first contentful paint. A much better default is to load your scripts with a tag: A deferred script has many...
The attached compiler() function below applies JavaScript behavior to matching HTML elements as they enter the DOM. This works like...
We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...
The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch...
The linked article points out that COUNT queries might be unexpectedly slow in PostgreSQL. If you just need to know...
When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...
Table of content for the linked article: 1. The `loading=lazy` attribute 2. Email, call, and SMS links
I encountered a unlucky behavior of byebug 11.1.3 (the most recent version at time of writing) when using it with...
rspec >= 3.1 brings a method and_wrap_original. It seems a bit complicated at first, but there are use cases...
The usual way to build a relation in a ActiveSupport::Concern is this: module MyModule extend ActiveSupport::Concern
When storing files for lots of records in the server's file system, Carrierwave's default store_dir approach may...
When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...
To attach files to your records, you will need a new database column representing the filename of the file...
When your Rails application server raises error, Capybara will fail your test when it clears the session after the last...
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
When you repeat a subpattern with a *, + or {...} operator, you may choose between greedy, lazy and possessive modes. Switching modes...
Recently I made an upgrade from Bootstrap 3 to Bootstrap 4 in a bigger project. Here are some tips how...
Consider the following models and form models: class Parent < ApplicationRecord has_many :children, class_name: 'Child', foreign_key: 'parent_id...
PostgreSQL has partial indexes. With a partial index you tell Postgres to only index rows matching a given query.
There are several tools for DNS debugging which offer you more or less information. Most of the time the more...
In my experience, the most common sources of memory leaks are APIs like these: addEventListener. This is the most common...
The Truemail gem (not to be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a...