Ruby: Using named groups in Regex

Named capture groups make complex regular expressions easier to read and extract values from, with match returning nil on no match and named_captures available in Ruby 2.4+.

Tint and Shade Generator

Simple web tool for creating lighter tints and darker shades from any HEX color value; oklch() can generate them by adjusting lightness.

Git: Finding changes in ALL commits

Git searches are often limited to the current branch, so changes can be missed across other refs, merges, or reflog entries. git log can search broader history with ref and path filters.

RubyMine: Find and Replace with Regex (Capture Groups and Backreferences)

Regex find-and-replace in RubyMine uses capture groups and backreferences to rewrite quoted text, URLs, and old RSpec syntax safely.

Avoid the FLOAT type for database columns

FLOAT can store slightly incorrect values because of precision semantics. DECIMAL offers predictable rounding and overflow behavior for numeric columns.

Using feature flags to stabilize flaky E2E tests

Always-on UI behaviors like polling, animations, autocomplete, and lazy loading can make E2E tests flaky; feature flags disable them by default and re-enable them only where needed.

Migrating from rbenv / nvm to mise

Replacing rbenv and nvm with mise centralizes Ruby and Node version management and avoids shell startup config conflicts during migration.

How to inspect Rails view cache keys (when using Redis)

Rails view fragments cached in Redis are hard to inspect, but Rails.cache.redis.with(&:keys) can list existing keys. Production keyspaces may be very large.

Making minimal updates to DOM trees using morphdom / idiomorph

Replacing DOM fragments with innerHTML wipes state such as form values, scroll position, and custom-element data. morphdom and idiomorph preserve existing nodes by applying minimal changes.

Custom Angular Test Bootstrap

Custom Angular test bootstraps centralize global providers, matchers, and test-wide setup while preserving CLI strict error checking.

Checklist: Using Carrierwave in a Rails project

Checklist for CarrierWave edge cases beyond the default Rails setup: secure URLs, image resizing, metadata handling, file validation, and efficient processing.

Ruby: Do not rescue without specifying exception classes

Bare rescue swallows StandardError and hides typos and other unexpected failures. Rescue only the specific exception you expect so monitoring still catches real bugs.

Jasmine: Cleaning up the DOM after each test

DOM-based Jasmine specs can leak leftover elements into later tests; using a dedicated fixture container cleared after each run keeps test state isolated.

File System Access API: Recursive Directory Traversal

Modern browsers can read selected folders and files with the File System Access API, reducing the need for ZIP upload workarounds when recursive directory handling is enough.

Rails: Adding a unique constraint for a has_one association might be a good default

A unique index on a has_one foreign key lets the database enforce 1:1 relationships and fail fast when application logic creates duplicate rows.

Rails: When to use :inverse_of in has_many, has_one or belongs_to associations

inverse_of lets Rails treat both sides of an association as the same in-memory object, reducing duplicate loads and fixing bi-directional association behavior.

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.

Defining class methods with Modularity traits

Trait parameters require define_singleton_method for class-level behavior; def self.foo works only without parameters, with normal class method visibility caveats.

Sentry Local Logging in Ruby

Local Sentry event logging helps debug error capture and background jobs without sending data to Sentry or affecting production metrics.

Using a virtual column for trigram indexes in PostgreSQL

Trigram indexes provide a lightweight alternative when full-text search becomes too rigid or slow. A virtual column can combine multiple text fields and support indexed LIKE queries.

Simple form examples with bootstrap

Building Bootstrap forms with simple_form reduces repetitive markup and keeps form layouts consistent.

Ruby: A small summary of what return, break and next means for blocks

return, break, and next behave differently in Ruby blocks: one exits the method, one exits the yielding method, and one skips only the current iteration.

Using ActiveRecord with threads might use more database connections than you think

ActiveRecord threads can open one database connection per thread, quickly exhausting server limits. Rails reuses and releases connections automatically, but manual cleanup is sometimes needed.

Unpoly: Passing Data to Compilers

Rails data can be passed to Unpoly compilers through data-* for simple strings and up-data for objects, arrays, and nested values.