Colorful output for several linux command line tools: grc

Adds colorized terminal output to common Linux commands, making logs and status output easier to scan in the shell.

How to evaluate CSS media queries in JavaScript

Responsive breakpoints can be checked in JavaScript with matchMedia() instead of duplicating CSS logic, and MediaQueryList change events track width updates efficiently.

Rails: Fixing the memory leak / performance issues in prepend_view_path

prepend_view_path can leak memory and bypass template caching when called per request, causing slower rendering in multi-tenant Rails apps.

Disable SimpleCov if you only run a fraction of your tests

Coverage reports add noise when only a small subset of tests runs; skipping SimpleCov for partial runs keeps output cleaner.

Javascript: How to match text by Unicode properties

Unicode character class escapes let JavaScript regular expressions match letters, numbers, and symbols beyond ASCII, making password checks work with umlauts and non-Latin digits.

ActiveRecord: Named bindings in conditions

Active Record where clauses can reuse the same value with named bindings, improving readability and avoiding repeated parameters in SQL conditions.

Capybara will not find links without an href attribute

JavaScript-heavy apps can render anchor tags that look clickable but lack href, so Capybara and assistive technology miss them. Adding href="#" makes link lookup and clicking work.

Don't define a controller action called #process

Controller actions can accidentally overwrite internal ActionController::Base methods such as process, causing bizarre behavior and ArgumentError failures when middleware calls them.

Improve accessibility with [aria-required] in SimpleForm

Screen readers can miss required fields when forms rely only on visual asterisks; aria-required adds an accessible required-state announcement without browser validation.

RSpec: Marking sections in long examples

Long RSpec examples are hard to scan and slow to report progress. A small STEP helper adds semantic section markers and clearer test output.

How to silence Puma for your feature tests

Feature specs can print noisy Puma startup logs when Capybara launches the test server. Setting Capybara.server = :puma, { Silent: true } suppresses the output.

How to use Ubuntu in English, but still show German formats

Keep Ubuntu in English while displaying dates, money, paper sizes and other regional formats in German by setting mixed locale variables.

Git: Rebasing dependent feature branches

Dependent feature branches need an explicit git rebase --onto after the base branch is squashed, or Git may replay already-merged commits and cause conflicts.

RSpec: Defining helper methods for an example group

Helper methods can be defined inside an RSpec example group and inherited by nested groups, but not by parent or sibling groups.

How to define a table prefix for all Rails models in a namespace

Rails namespaces can produce doubled table prefixes when table_name_prefix is set on individual models. Defining it on the namespace module keeps nested model table names correct.

How to find out what is running on a port on a remote machine

Remote ports can hide unexpected services, and nmap can identify the daemon and version behind a TCP port. Useful when a server exposes the wrong service or response.

RSpec Argument Matchers: Expecting non-primitive objects as method invocation arguments

RSpec can verify method arguments that are objects by class, interface, attributes, equality, or custom block checks instead of simple primitive values.

Managing chrome versions for selenium

Browser and driver mismatches can break Selenium tests; Selenium Manager can fetch matching Chrome and chromedriver versions automatically, though the first run is slower.

Webpack(er): Analyze the size of your JavaScript components

Keep JavaScript bundles small with webpack-bundle-analyzer, which visualizes module size and highlights large chunks before production.

Custom error pages in Rails

Custom Rails error pages can be rendered through controllers instead of static public files, allowing layouts, helpers, and tests for 404 and 500 responses.

Don't forget: Automatically remove join records on has_many :through associations

has_many :through associations can leave orphaned join rows after deleting a parent record. dependent: :destroy removes the join records while keeping the associated records.

Rails: Handling actions that need to happen after all transactions

ActiveRecord.after_all_transactions_commit runs work only after every open transaction commits, or immediately when none is open. It suits side effects like email delivery after persisted state changes.

Rails: Testing exceptions with the rescue_responses setting

Rails 7.2 changes show_exceptions defaults in tests, so rescued RecordNotFound often becomes a 404 response instead of a raised exception.

RSpec: Defining negated matchers

RSpec::Matchers.define_negated_matcher creates readable inverse matchers for composed expectations and clearer failure messages, but only for atomic matchers with unambiguous negation.