PSA: Chrome and Firefox do not always clear session cookies on exit

Chrome and Firefox can retain session cookies on exit when reopening tabs from the last session, so browser shutdown does not always end cookie lifetime.

ActiveRecord: count vs size vs length on associations

size is usually the right way to count associated records in Rails; count can ignore loaded children, while length loads everything.

nvm: Setting a default Node.js version

Set a persistent default Node.js version for new shells with nvm alias default, including an LTS release.

Toggling a maintenance page with Capistrano

Capistrano can switch an app into maintenance mode by publishing a static page on each web server, with customizable message, timing, and template.

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.

Rails: Including HTML in your i18n locales

Rails t automatically marks _html translations as HTML-safe, allowing intentional links and formatting while still escaping unsafe interpolations.

8 steps for fixing other people's code

Making fixes in someone else’s GitHub repository is easier with modern open source tools, but pull requests and branch workflow still need care.

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.

A restrictive (but still practicable) CSP for Rails projects

A strict Content Security Policy for Rails limits scripts to nonce-approved sources while keeping styles, images, forms, and fonts workable.

When you want to format only line breaks, you probably do not want `simple_format`

Rendering text with only line-break handling can avoid simple_format's HTML-preserving side effects. A small helper or white-space: pre-wrap keeps output predictable.

Caching file properties with ActiveStorage Analyzers

Slow PDF property lookup can avoid repeated downloads by caching intrinsic file metadata such as page count on ActiveStorage::Blob and using custom analyzers for shared uploads.

Detect the current Rails environment from JavaScript or CSS

Expose Rails.env on <html> to branch JavaScript and CSS by environment, making Selenium- and test-specific behavior easy to toggle.

Running "bundle update" will update all gems without constraints

bundle update without arguments refreshes every gem and can break an app; updating gems regularly and conservatively reduces risky dependency changes.

Best practices: Large data migrations from legacy systems

Large legacy data migrations need deep source-system understanding, fast failure, dedicated logging, and traceable migration metadata to keep long-running imports debuggable and verifiable.

How to fix "Could not resolve any esbuild targets" when building assets

Outdated browserslist data can make esbuild-plugin-browserslist fail with “Could not resolve any esbuild targets” when a stale query matches no known browsers.

Sending newsletters via rapidmail with SMTP and one-click unsubscribe

Newsletter delivery via SMTP with rapidmail, plus Gmail-compatible one-click unsubscribe using signed tokens and List-Unsubscribe headers.

Careful when using Time objects for generating ETags

Time values in ETag generation can lose millisecond precision, causing stale cache hits and flaky tests. Convert them to strings or numbers before combining cache keys.

Rails developers: Have better context in Git diffs

Git can show the wrong surrounding code in Ruby diffs unless file types are mapped to better hunk headers. Custom diff drivers and xfuncname improve context for Rails, RSpec, and Cucumber files.

Ensure deterministic ordering of records

Records created close together can share the same timestamp, making timestamp-only sorting unstable. Adding the primary key as a final order condition keeps list ordering deterministic.

Using PostgreSQL ranges with ActiveRecord

PostgreSQL range types store date and time intervals in one column and fit ActiveRecord casting, overlap queries, and exclusion constraints for booking data.

TypeScript: Enable strict-boolean-expressions for Safe Nullish Checks

Falsy values can make && and || null checks unsafe in TypeScript; ??, optional chaining, and strict-boolean-expressions prevent silent bugs.

Ruby: How to use prepend for cleaner monkey patches

prepend makes Ruby monkey patches cleaner by inserting an extension before the original implementation, so super still reaches it and ancestor chains stay readable.

Defining new elements for your HTML document

Custom elements let you create semantic HTML components that browsers render normally and activate directly with customElements.define(), avoiding framework-specific compilation.

How to reload a belongs_to association

Reload a single-record Rails association without reloading the whole parent object; Rails 5+ uses reload_<association>, older versions accept association(true).