HTML5: disabled vs. readonly form fields

Noneditable HTML form controls behave differently with disabled and readonly: submission, focus, and tab order change, and browser quirks can affect fieldset descendants.

How to create a terminal progress indicators in Ruby

Long-running Ruby scripts need terminal feedback, and a simple percentage display can track batch progress without extra dependencies.

How to automatically optimize SVG files with esbuild

SVG files often carry metadata and hidden elements that bloat output. svgo can run as an esbuild plugin to optimize them during builds.

Rails: Using PostgreSQL full-text search without a gem

PostgreSQL can handle full-text search in Rails without extra gems, with cached vectors, ranking, weighting, and stemming for faster, more flexible message search.

Overview of method delegation in Rails

Forwarding methods in Rails reduces deep call chains and boilerplate when exposing data from associated objects or decorators.

RSpec: Executing specs by example id (or "nesting index")

Running one RSpec example without line numbers avoids fragile file-position matches when specs change. Example ids, also called nesting indexes, target the example tree directly.

Rails: Overwriting default accessors

Customizing Active Record attribute readers and writers can trim or normalize values before persistence, while direct attribute storage bypasses other overridden behavior.

How to not die with ActionView::MissingTemplate when clients request weird formats

HTTP clients can request unsupported formats and trigger ActionView::MissingTemplate when only HTML templates exist; restricting routes or responding with 406 avoids the error.

Flexbox: flex-basis vs. width vs. min-width vs. max-width

CSS Flexbox sizing can be confusing when flex-basis, width, min-width, max-width, and content size compete. min-width: 0 often prevents overflowing children.

HTML forms with multiple submit buttons

Forms can offer multiple submit actions such as save, accept, or reject, but the server must know which button was pressed. formaction sends each button to a different URL.

Rails routing: Using constraints to avoid "Missing template" errors

Route constraints prevent ActionView::MissingTemplate errors on wrong requests by returning 404s instead of reaching an unmatched format or template lookup.

Haml Whitespace Preservation (or: Fixing Textarea Indentation in Haml)

Haml indentation can leak into preformatted text and textareas, adding unwanted leading spaces. Using ~ instead of = preserves whitespace without extra indentation.

Why your Cucumber feature loses cookies when run under Selenium

Cucumber/Selenium tests can lose cookies and sessions when the app and browser run in different times, because old dates make cookies expire immediately.

Clean code: Avoiding short versions in command options

Shared command examples are easier to read and search when options are written out instead of shortened to cryptic flags.

Git: Restore

git restore reverses staged, unstaged, deleted, or conflicted changes with clearer intent than git checkout, and can restore files from other revisions.

Capybara: Working with invisible elements

Capybara hides non-rendered nodes by default, so hidden UI elements need explicit visibility options to be found or asserted in tests.

Defining and calling lambdas or procs (Ruby)

Ruby Proc objects can behave as strict lambdas or flexible blocks, affecting argument handling and return behavior when code is wrapped as callable objects.

ActiveStorage: How to add a new preprocessed named version

Preprocessed ActiveStorage variants let avatars be generated ahead of time for faster display, but existing records need a one-time backfill after adding the named version.

ActiveStorage: How to copy / clone an attachment from one record to another

Reusing an existing uploaded file for another record avoids reuploading avatars and can copy the blob directly, though large attachments may need a memory-safe approach.

Using Low-Level Prompts for High-Accuracy AI Coding

Precise, low-level prompts and tight context improve AI code edits across files; structured keywords, reusable patterns, and early review reduce guesses and errors.

Git commands to discard local changes

Removing local Git modifications is useful when work needs to be undone, parked temporarily, or cleaned from tracked and untracked files without affecting remote history.

RSpec: Tagging examples and example groups

Tagging RSpec examples and groups lets you filter slow or special cases, assign values, and trigger hooks or module includes by metadata.

PSA: "index: true" in Rails migrations does not work as you'd expect

index: true is silently ignored in some Rails migration methods like add_column, so missing database indexes can go unnoticed and hurt query performance.

Writing a README for a project

A project README gives new developers a quick overview, key architecture, and setup notes. Keep it concise, focused on essentials, and separate detailed class documentation.