ActiveRecord: validate_uniqueness_of is case sensitive by default

Rails uniqueness validation treats username and USERNAME as different by default, which can conflict with MySQL’s case-insensitive comparisons and unique indexes.

Migrating from Elasticsearch to Opensearch: searchkick instructions (without downtime!)

Zero-downtime migration from Elasticsearch to OpenSearch for Searchkick apps, including staging validation, client switching, and environment-specific index settings.

You should be using the Web Animations API

Browser support is strong for the Web Animations API, which lets JavaScript animate DOM elements and await or cancel CSS transitions and animations.

Be careful when checking scopes for blankness

blank? on an ActiveRecord::Relation can load every row into memory and stall workers; use nil checks or exists?/empty? for cheap scope checks.

Rails route namespacing (in different flavors)

Rails routes can separate URL segments, helper names, and controller modules, letting you namespace controllers or change paths without affecting the other dimensions.

ES6 imports are hoisted to the top

ES modules are hoisted, so import order in source can differ from execution order and break code that depends on globals like $.

How to examine an unknown Ruby object

Inspect unfamiliar Ruby objects during debugging by listing methods, filtering names, and checking instance variables when source code is unavailable.

How to display an unsaved changes alert

Unsaved form edits can be lost when a tab closes or a full page unload occurs. beforeunload with preventDefault() triggers the browser's standard warning.

Working on the Linux command line: How to bash `cd` with autocorrect

cdspell can correct small cd typos automatically, and aliases can map common command misspellings to the intended command.

How to discard ActiveRecord's association cache

ActiveRecord association data can stay stale after changes; reset clears the cache without querying, while reload fetches fresh rows immediately.

In Chrome 121+ the now supported spec-compliant scrollbar properties override the non-standard `-webkit-scrollbar-*` styles

Chrome 121+ gives scrollbar-width and scrollbar-color precedence over ::-webkit-scrollbar-*, so existing scrollbar styling can regress unless CSS is gated by browser support.

Heads up: You should always use "current_window.resize_to" to resize the browser window in tests

Flaky browser tests can run at the wrong size on slow CI runners when window resizing returns too early; Capybara page.current_window.resize_to waits for a stable dimension.

Use <input type="number"> for numeric form fields

Numeric form fields on mobile get digit-focused keyboards, locale-aware decimal display, and consistent point-based values in JavaScript and form submission.

CI Template for GitHub Actions

GitHub Actions CI template for Rails apps with parallel RSpec, RuboCop, ESLint, license checks, security scanning, and merged coverage reports.

Configuring Git with .gitconfig

Simple Git configuration for new developers: aliases, merge and rebase defaults, better diffs, and GitLab push shortcuts.

Where to keep project files that should not go to Git

Keep project-related notes, logs, and dumps outside version control in a dedicated related-files/ directory, ignored globally with ~/.gitignore.

Firefox ESR Release Calendar

Firefox ESR keeps a fixed browser version for a year with security backports only, while overlapping releases give enterprises three months to test and migrate.

How to configure Selenium WebDriver to not automatically close alerts or other browser dialogs

Selenium WebDriver dismisses browser dialogs by default and can close alerts before tests react. Setting unhandled_prompt_behavior to ignore leaves prompts open until handled.

Better numeric inputs in desktop browsers

Desktop number fields accept scientific notation, arrow-key changes, wheel scrolling, and stray letters, causing accidental edits and validation errors.

Action Mailer Previews

Previewing Rails emails in the browser catches layout and content issues before delivery and helps keep mailer output aligned with expectations.

Concurrency issues with find-as-you-type boxes

Live search boxes can show stale results when AJAX responses arrive out of order, causing flashing and mismatched suggestions. Serializing requests or discarding outdated responses avoids the race condition.

Include keystrokes in a screencast

Show pressed keys on screen for screencasts or screen sharing with screenkey, and adjust the overlay through its settings window.

Best practices: Writing a Rails script (and how to test it)

Rails one-off scripts need idempotence, transactions, transparency, and robust error handling; isolating logic from input also makes them testable.

Accessing JavaScript objects from Capybara/Selenium

Capybara and Selenium can access only browser globals, so exported JavaScript modules fail in evaluate_script unless the component instance is attached to the element.