Let a Rails 3 application make a request to itself
Rails 3 can issue internal HTTP requests through the Rack interface, useful for Cucumber features and testing app responses without a browser.
How to evaluate CSS media queries in JavaScript
Responsive breakpoints can be checked in JavaScript with matchMedia() instead of duplicating CSS logic, and MediaQueryList change events track width updates efficiently.
How to stub class constants in RSpec
RSpec cannot stub constants directly; using attributes, wrapper methods, or test helpers makes constant-dependent code easier to isolate.
Test a download's filename with Cucumber
Verify that a server response suggests the expected download name in a Cucumber scenario, using Capybara or Webrat to check the Content-Disposition header.
How to overwrite and reset constants within Cucumber features
Cucumber feature tests can temporarily replace global constants and restore them after each scenario, including newly created constants, without warning noise.
whenever: Installing cron jobs only for a given Rails environment or Capistrano stage
Conditional cron jobs in whenever can target only one Rails environment or Capistrano stage, avoiding unwanted tasks on other deployments.
ActiveRecord: Cleaning up your database with ignored_colums
Unused database columns confuse teams and can linger safely while legacy access is phased out. ignored_columns removes Rails accessors and helps flag fields for later removal.
Manually trigger a delegated DOM event
Delegated jQuery events can be hard to fire programmatically for testing; native dispatchEvent with the right event class works better than trigger in many cases.
Migrating from Elasticsearch to Opensearch: searchkick instructions (without downtime!)
Zero-downtime migration from Elasticsearch to OpenSearch for Searchkick apps, including staging validation, client switching, and environment-specific index settings.
Test your CSS rendering output with GreenOnion
Front-end styling regressions are hard to catch in views and pages. GreenOnion stores browser snapshots and compares them with diff images or percentage differences.
An incomplete guide to migrate a Rails application from paperclip to carrierwave
Rails file storage migration with background jobs, reruns, and URL rewrites; large media backfills need careful testing, queue tuning, and fallback handling.
Rails: Rest API post-mortem analysis
Rails API backends can be fast and easy to extend, but serializer maintenance, schema drift, documentation limits, and missing rate limits create real operational risks.
Jasmine: Testing if two arrays contain the same elements
Array comparisons in Jasmine need different matchers for exact order, unordered equality, or subset checks when testing collections.
Do not use transparent PNGs for iOS favicons
Transparent apple-touch-icon images on iOS turn black in Safari, so solid backgrounds prevent ugly home-screen and bookmark icons.
Five years of "Today I Learned" from Josh Branchaud
A curated set of 900+ personal programming tips spans Ruby, Rails, Git, Unix, Chrome, and JavaScript, with many small shortcuts for daily development work.
Video transcoding: Web and native playback overview (April 2020)
Browser video playback depends on container and codec support; MP4 with H.264 and AAC works broadly, while WebM can serve modern clients and downloads need native playback support.
Custom RSpec matcher for allowed values (or assignable_values)
Custom RSpec matcher for checking allowed association values, useful when validating assignable_values on model associations.
Jasmine: using async/await to write asynchronous specs
Readable Jasmine specs can use async/await for promises, async setup, event waiting, and controllable async spies instead of done callbacks.
Use CSS "text-overflow" to truncate long texts
Single-line text can overflow its container in Rails views; text-overflow: ellipsis and white-space: nowrap produce cleaner truncation in supported browsers.
Ruby bug: Symbolized Strings Break Keyword Arguments in Ruby 2.2
Dynamically created symbols can make keyword arguments turn nil in Ruby 2.2 when a method uses several keywords and **options.
makandra/gemika: Helpers for testing Ruby gems
A library for testing a Ruby gem against multiple Ruby, dependency and database combinations, with shared local and CI setup for full permutation coverage.
RSpec's hash_including matcher does not support nesting
hash_including cannot match nested hashes reliably; use nested matchers such as include or another hash_including for partial hash checks.
Why preloading associations "randomly" uses joined tables or multiple queries
ActiveRecord :include can switch between separate queries and SQL joins, causing ambiguous ORDER BY clauses and hidden production bugs when associations are preloaded.
Debug SAML in development using a local keycloak server
Local Keycloak can emulate a SAML identity provider for development, letting SSO flows and attribute mapping be tested without waiting on an external IDP.