Rails: Overriding view templates under certain conditions only

Use request-specific view paths to swap in alternate templates for selected conditions, with fallback to the default templates when no override exists.

Pretty commit messages via geordi

Generate polished Git commit messages from Linear stories, including issue ID, title, and link, using geordi commit and a .geordi.yml repository config.

A quick introduction to CORS

Cross-origin browser requests need explicit server approval; otherwise the Same-Origin Policy blocks access. CORS uses Origin and Access-Control-Allow-Origin headers, with preflight checks for some methods.

Rails: Your index actions probably want strict_loading

Strict loading in index actions catches N+1 queries when views touch unpreloaded associations, causing test failures instead of hidden database hits.

Rails: How to test the parsed response body

Rails response tests can parse bodies by MIME type with parsed_body, replacing manual JSON.parse(response.body) in many cases and enabling cleaner assertions.

How to exclusively lock file access in ruby

Prevent race conditions when multiple Ruby processes read or write the same file by using flock for exclusive locking, optionally via a companion .lock file.

SASS: Reusing styles from other files

@extend reuses Sass selectors, but multi-file bundling can duplicate imported styles and break the expected selector merging.

How to enable template coverage support for simplecov

Template and eval coverage in Ruby can be tracked with SimpleCov from Ruby 3.2 onward, including Haml and ERB templates.

FactoryBot: Passing attributes to associated records using transient attributes

FactoryBot transient attributes can pass custom values into associated records, letting parent factories build children with dynamic names and flags.

Rails migration: Changing a column type without losing the content

Rails migrations can change column types without dropping data by using custom SQL casting, but rollback may fail when values cannot be converted.

Creating a sample video with ffmpeg

Create tiny test videos with ffmpeg by lowering resolution, framerate, and bitrate to keep files small while preserving duration.

Heads up: Deployment with newly generated SSH key (using ED25519) might fail

Capistrano deployments can fail with ssh-ed25519 keys because net-ssh needs ed25519 and bcrypt_pbkdf; stale host fingerprints in ~/.ssh/known_hosts can also block access.

Issue Checklist Template

Personal issue workflow checklist for moving features from start to review, with branch, commit, merge request, testing, and staging handoff steps.

Rails: Using database default values for boolean attributes

Boolean fields in Rails are safer with database defaults and NOT NULL constraints; application-level fallbacks are brittle, especially for tri-state values and instance-dependent defaults.

Configuring RubyGems to not install documentation by default

Gem installations waste time generating local docs that are rarely used; disabling documentation by default speeds up manual installs with gem and ~/.gemrc.

How to turn images into inline attachments in emails

External images in emails can fail in some clients; inline attachments with Rails and attachments.inline keep images visible, but turn messages into multipart emails and use content IDs.

Rails: Encrypting your database information using Active Record Encryption

Rails 7 app data can be stored as encrypted attributes with deterministic lookup support, but search, grouping, and bulk updates become limited.

git: find the version of a gem that releases a certain commit

Find the gem version that first contains a commit by using git name-rev --tags; it points to the next release tag after the change.

Rails: Accessing helper methods from a controller

Controllers can call view helpers in Rails 5+ through helpers, while older Rails versions use view_context to reach methods like link_to.

Pattern: Disabling a certain feature in tests

Integration tests often break on cookie banners or captchas. A test-only switch disables them by default while allowing targeted reactivation for specific cases.

Lazy-loading images

Loading large page images only when they enter the viewport cuts bandwidth use and can improve perceived speed. Missing crawler support and layout shifts remain common issues.

Preconnect, Prefetch, Prerender ...

Early browser hints can reduce page load latency by preparing DNS lookups and connections before navigation.

RSpec: How to compare ISO 8601 time strings with milliseconds

Rails JSON serializes times with milliseconds, so iso8601 and to_json can differ in RSpec expectations. Using to_json keeps time string comparisons matching.

How to kill a Rails development server by force

A stuck Rails development server can keep port 3000 busy and trigger EADDRINUSE; lsof and kill -9 can force it down.