Nokogiri: CSS syntax for XML namespaces

Selecting XML namespace elements with CSS in Nokogiri requires | instead of : for namespaced names like soapenv|Envelope.

Cucumber may complain about cucumber.yml being invalid when it is valid

Cucumber can report cucumber.yml as invalid even when it parses correctly; an invalid rerun file like tmp/rerun.txt may trigger the error.

Legacy CarrierWave: How to generate versions with different file extensions

CarrierWave can create versions with fixed extensions like mp4, but it needs custom uploader logic to keep filenames, MIME types, and cache handling consistent.

How Rails and MySQL are handling time zones

Rails and MySQL handle datetimes differently: local-zone storage can avoid conversions, while UTC mode supports per-request zones but requires Time.current and careful timestamp handling.

You don't need each, collect or select in Coffeescript

CoffeeScript for comprehensions replace _.each, _.map, and _.select for cleaner list processing without underscore helpers.

Rspec: How to write better specs

RSpec tests are easier to maintain with clearer structure and disciplined style, but recommendations still need judgment; the Self-Contained Test is a complementary approach.

How to reset a Mock

Mock expectations in RSpec can linger across examples; resetting a proxy removes the configured doubles and returns the object to its original state.

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.

How Ruby method lookup works

Ruby method dispatch follows a fixed lookup chain across singleton classes, prepended modules, class methods, included modules, and superclasses.

Rspec: Expecting a Rake task to be called

Rake tasks can be verified in RSpec by expecting Rake::Task to receive invoke, useful for testing task-triggered side effects without putting logic in tasks.

How to use git fixup

git commit --fixup creates a follow-up commit that git rebase --autosquash can fold into an earlier change, keeping feature-branch history tidy.

Installing multiple MySQL versions on the same Linux with mysql-sandbox

Run several MySQL releases side by side in one Linux account for testing or Rails development, using isolated sandboxes on separate ports.

Rails: When defining scopes with class methods, don't use `self`

Scopes defined as class methods can drop earlier filters when they return self; use all to preserve chained conditions in Rails 2 and 5.

Rubygems: Installing the last version of rubygems that has no rubyforge_project deprecation warning

Rubygems 3.1+ adds a Gem::Specification#rubyforge_project deprecation warning that can clutter development logs; installing 3.0.8 avoids it on older projects.

Git: How to add changes matching a regular expression

Stage only matching lines from a large git diff and commit them separately by filtering hunks with grepdiff before git apply --cached.

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.

Rails: Concurrent requests in development and tests

Puma concurrency in Rails depends on workers and threads; self-calls during a request can deadlock in development or tests unless multiple workers are enabled.

How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber

Code coverage reveals untested Rails paths and blind spots across RSpec, Cucumber, and parallel test runs. SimpleCov can separate reports and add branch coverage.

Using #deep_dup for copying whole hashes and array

#dup and #clone only copy the top level of nested hashes and arrays; #deep_dup duplicates the full structure, but cycles can trigger SystemStackError.

How to: Throttle CPU in Google Chrome

Limit Chrome CPU speed to measure frontend performance and reproduce sluggish behavior in DevTools.

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.

Devise: How to allow only HTTP Basic Auth and disable the HTML sign-in form

Force Devise to use browser Basic Auth instead of the HTML sign-in form by enabling http_authenticatable and removing navigational formats.

How to write good code comments

Comments work best when they explain why code exists, not what it does, and stay close to the relevant code, robust against change.