List of default browser stylesheets
Browser default styles affect pages with no CSS and differ between Chrome, Firefox, and Safari, making layout comparisons and reset strategies inconsistent.
A very compatible default CSP for Rails projects
Keep Rails apps protected with a minimally restrictive Content Security Policy that blocks injected scripts while preserving compatibility with nonces and strict-dynamic.
Know your Haml comments
Haml supports HTML comments that reach the browser and Ruby comments that stay server-side, with indentation errors causing confusing syntax failures.
Merging two arbitrary ActiveRecord scopes
Rails ActiveRecord::Relation#merge can silently drop conditions on the same column; a subquery keeps combined scopes unambiguous.
Testing if two date ranges overlap in Ruby or Rails
Date and time interval checks are easy to get wrong because partial, nested, and touching ranges all count as overlaps. A simple inclusive comparison works for Ruby and Rails.
Zeitwerk: How to collapse folders in Rails
Rails can keep subfolders for organization without turning them into namespaces; collapse lets nested files define top-level constants instead of modules.
How to: Upgrade CarrierWave to 3.x
CarrierWave 3.x changes upload allowlists, inactive versions, version recreation, and processing paths, breaking older uploader logic and custom transcoders.
Google Chrome: How to restore the old downloads bar
Chrome's old downloads bar offers faster access, visible progress, single-click opening, and easier drag-and-drop reuploads than the newer downloads dropdown.
Geordi hints
Quick Geordi command shortcuts for guided deployment, setup, security updates, tracker-based commits, and matching ChromeDriver installation.
Regular Expressions: Space Separators
\s misses non-breaking spaces in UTF-8 text; [[:space:]] and \p{Zs} match space separators more reliably, with encoding compatibility caveats.
Solving "TypeError (nil can't be coerced into Integer)" in the Rails console / IRB
Rails console assignments can print TypeError (nil can't be coerced into Integer) even when they succeed. The bug affects IRB with --nomultiline and is fixed in reline 0.2.0.
PSA: Be super careful with complex `eager_load` or `includes` queries
eager_load and includes can explode 1-n association queries into huge cross products, wasting memory. preload uses separate queries and avoids the row multiplication.
Ruby: `extend` extends the singleton class's inheritance chain
extend places module methods into a singleton class’s ancestor chain, which affects class methods, method lookup, and super behavior.
Debug MiniMagick calls in your Rails app
CarrierWave hides MiniMagick processing failures behind a generic error; enabling MiniMagick.logger.level = Logger::DEBUG reveals the underlying ImageMagick commands and helps trace the cause.
Heads Up: Selenium 4 uses a binary to determine the chromedriver
Selenium WebDriver 4 can pick an incompatible browser binary in CI, breaking feature tests when Chromium and Chrome versions differ. Setting binary avoids selenium-manager selecting or downloading the wrong browser.
Heads up: Quering array columns only matches equally sorted arrays
PostgreSQL array queries in Rails match element order, so [16, 17] and [17, 16] are different. Order-independent matching needs normalization or bidirectional containment.
Ensure passing Jasmine specs from your Ruby E2E tests
Run Jasmine specs through Rails E2E tests to catch JavaScript failures in regular test runs and verify the runner finishes with all specs passing.
Things you probably didn’t know you could do with Chrome’s Developer Console
Useful Chrome DevTools console tricks for editing pages, timing code, inspecting elements, and reusing previous results.
Preventing users from uploading malicious content
Uploaded HTML or SVG can execute JavaScript and steal session cookies; safer uploads rely on extension allowlists, strict CSP, attachment disposition, or octet-stream delivery.
Carrierwave: Deleting files outside of forms
Removing CarrierWave attachments outside forms can affect the database and file storage differently. update!(remove_avatar: true) matches normal form behavior and is usually the safest choice.
RSpec: Leverage the power of Capybara Finders and Matchers for view specs
View specs can stay fast and readable by querying rendered HTML with Capybara finders and matchers instead of relying on heavier request or feature specs.
Whenever: Don't forget leading zeros for hours!
Whenever can misread 24-hour times without a leading zero, turning 3:00 into 3pm instead of 3am. chronic_options can switch parsing to a 24-hour clock.
Heads up: RSpec's diffs may not tell the truth
RSpec diffs can mislead when matchers print like failures or when Time.now values differ only by milliseconds.
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.