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.

A simpler default controller implementation

Rails controllers can stay short, testable and authorization-friendly by using a minimal shared blueprint for CRUD, strong params, scopes and optional HTTP caching.

Geordi: Running Selenium tests in a VNC buffer

Selenium browser windows can run inside a VNC buffer instead of appearing on the desktop, while still allowing inspection when needed.

Installing multiple MySQL versions on the same Linux with mysql-sandbox

Run several MySQL releases side by side in one Linux account for testing or Rails development, using isolated sandboxes on separate ports.

Passive event listeners may speed up your scroll and touch events

Passive listeners let the browser keep scrolling responsive by not waiting for touch or wheel handlers that never cancel default behavior.

CSP: Nonces are propagated to imports

Module scripts with a nonce automatically pass that trust to dynamic import(), enabling chunk loading under restrictive CSP without strict-dynamic.

How to update a single gem conservatively

Updating one gem with bundle update can pull in dependency upgrades and break existing code. Bundler --conservative limits changes to the targeted gem and avoids unnecessary transitive updates.

How to disable Chrome's save password bubble for Selenium tests

Chrome’s password-save bubble can clutter Selenium debugging when forms trigger credential prompts. Disabling the password manager via profile prefs or using Incognito suppresses it.

E-mail deliverability

High-volume transactional email often gets blocked by spam filters and denylist issues, making reliable delivery hard even with standard SMTP relays.

How to get notified when Claude Code needs your input

Desktop notifications for Claude Code prevent missed prompts when the agent pauses for input; clicking the alert can reopen the project in your IDE.

Limiting GitLab CI runner to specific branches or events

Control when CI jobs run by matching branches, merge requests, and other pipeline conditions with rules; rules replaces only and except in GitLab 12.3+.

Capybara: Quick checking for element presence (without retries or timeout)

Capybara presence checks can wait for seconds or raise on find; has_css? with wait: 0 returns immediately for quick boolean checks.

Spreewald, Cucumber: Selector for the nth Element

Custom Cucumber selectors in Spreewald make it easy to target repeated form fields by ordinal position, but :nth-of-type can break when surrounding HTML changes.

whenever: Installing cron jobs only for a given Rails environment or Capistrano stage

Conditional cron jobs in whenever can target only one Rails environment or Capistrano stage, avoiding unwanted tasks on other deployments.

Locally testing a website on its real domain

Use a real production domain in local development for testing embeds, cookie banners, and other domain-allowlisted integrations by mapping it to localhost with HTTPS.

Selenium may break with ChromeDriver 75+

ChromeDriver 75+ can trigger W3C errors in Selenium tests, and browser log access may fail. Disabling w3c in Chrome options restores the older behavior.

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.

Let a Rails 3 application make a request to itself

Rails 3 can issue internal HTTP requests through the Rack interface, useful for Cucumber features and testing app responses without a browser.

How to stub class constants in RSpec

RSpec cannot stub constants directly; using attributes, wrapper methods, or test helpers makes constant-dependent code easier to isolate.

Test a download's filename with Cucumber

Verify that a server response suggests the expected download name in a Cucumber scenario, using Capybara or Webrat to check the Content-Disposition header.

How to overwrite and reset constants within Cucumber features

Cucumber feature tests can temporarily replace global constants and restore them after each scenario, including newly created constants, without warning noise.

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.

An incomplete guide to migrate a Rails application from paperclip to carrierwave

Rails file storage migration with background jobs, reruns, and URL rewrites; large media backfills need careful testing, queue tuning, and fallback handling.

Jasmine: Testing if two arrays contain the same elements

Array comparisons in Jasmine need different matchers for exact order, unordered equality, or subset checks when testing collections.