How to eager load a single directory with Zeitwerk

Zeitwerk can eager load a single subdirectory so descendant classes are available for iteration, while avoiding manual require of the parent file.

jeremyevans/ruby-warning: Add custom processing for warnings

ruby-warning customizes Ruby warning handling, letting specific messages or paths be ignored, warnings turned into errors, backtraces attached, and duplicates removed.

CSS: Matching against attributes and their values (or parts of them)

CSS attribute selectors can target partial values, letting links, classes, and other attributes be styled by prefixes, suffixes, substrings, or whitespace-separated tokens.

JavaScript: Calling a function with a variable number of arguments

Passing an array as separate arguments avoids treating the whole array as a single value; ES6 ... and ES5 apply spread elements into a function call.

Rails: Using normalizes without copying code

Rails 7.1 input cleanup can be reused across models by replacing inline lambdas with callable normalizer classes and a shared base interface.

Carrierwave: How to remove container directories when deleting a record

Deleting uploaded files in Rails leaves empty CarrierWave folders behind; a cleanup hook can remove empty parent directories after record deletion.

SameSite cookies

Browser defaults are shifting toward SameSite=Lax, making cross-site cookie behavior stricter and exposing iframe, API, and non-GET request flows that need SameSite=None or Strict.

How to update the bundler version in a Gemfile.lock

Bundler versions in Gemfile.lock can lag behind the installed release and break compatibility with older Ruby or Rails setups. Updating bundler and regenerating the lockfile keeps BUNDLED WITH aligned.

Designing HTML emails

Email client rendering is inconsistent, so HTML messages need table-based layouts, inline styles, and client-specific workarounds to remain readable across major mail apps.

Project management best practices: Working with clients in person

Regular in-person contact can strengthen collaboration with clients or external product managers and make difficult project discussions easier.

It's OK to put block elements inside an <a> tag

HTML5 allows an <a> tag to wrap block content like paragraphs, lists, and sections, making whole regions clickable without invalid markup.

tig: install a more recent version

Ubuntu 22.04 ships an older tig build with weaker completion; Debian packages can provide newer fixed releases for an upgrade.

Capistrano task to edit staging / production credentials

Editing Rails credentials for staging or production requires server-only secret keys; a Capistrano task opens the decrypted file without copying keys to a dev machine.

Ruby / Rails: clone vs. dup vs. deep_dup

Copying Ruby objects can preserve or drop frozen state, singleton methods and mixins, while nested references stay shared unless a true deep copy is used.

Dealing with I18n::InvalidPluralizationData errors

Rails can raise I18n::InvalidPluralizationData when a localized association name is looked up as model data. Adding the missing attribute translation or a matching one key fixes the error.

Tom Select: How to adjust the delay for options list to update

Tom Select’s option filtering can lag by 300 ms after typing, and refreshThrottle can shorten the update delay for faster keyboard selection.

A different testing approach with Minitest and Fixtures

Minitest and fixtures can speed up slow Rails test suites, especially where RSpec and FactoryBot add overhead. Minimal fixtures and explicit assertions keep tests maintainable.

Running Cucumber deletes my whole app!

Capybara Screenshot can delete the application directory during a Cucumber run when screenshots are stored in .. Upgrading to 1.0.26 and setting Capybara.save_path avoids the destructive cleanup.

Timeouts for long-running SQL queries

Database query limits prevent runaway SQL from consuming all resources; PostgreSQL statement_timeout and MySQL max_execution_time can cancel slow statements automatically.

Ruby: Replacing Unicode characters with a 7-bit transliteration

Unicode characters can break 7-bit string transport; transliteration to Low-ASCII keeps text usable where escaping is not possible.

Be careful when copy & pasting code from the web to your terminal

Copied terminal commands can hide invisible Unicode characters or lookalike symbols, causing unexpected behavior. Checking exact code points helps avoid paste-related mistakes.

RSpec: Increase readability with super_diff

Hard-to-read RSpec diffs for nested hashes and collections can be improved with super_diff, which formats expectation mismatches more clearly.

Don't compare datetimes with date ranges in MySQL and PostgreSQL

Date ranges can silently miss rows when compared to created_at datetimes in MySQL or PostgreSQL, because the end date is cast to midnight and late-day records are excluded.

Chrome Lighthouse

Built-in Chrome auditing checks performance, accessibility, and other quality signals for web apps, including private or local pages. Development settings can skew results; Webpagetest is an alternative.