Parallelize Development Using Git Worktrees

Use git worktree to keep multiple working trees on one repository, so you can test, compare versions, and switch branches without disturbing current work.

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.

Use Time.current / Date.current / DateTime.current on projects that have a time zone

Time zone-aware projects need Time.current, Date.current, and DateTime.current so values persist correctly; Time.now can write timestamps with the wrong zone.

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.

RSpec: Ensuring a method is called on an object that will be created in the future

RSpec’s and_wrap_original can attach expectations to objects created during a call, making it easier to verify the right validator instance without relying on expect_any_instance_of.

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.

How to make sure that manual deploy tasks (scheduled in Pivotal Tracker) are executed on deploy (with Capistrano)

Manual deploy work around releases can be missed easily; tracking pre- and post-deploy tasks in Pivotal Tracker and wiring them into Capistrano adds a safety net.

JavaScript: Don't throw synchronous exceptions from functions that return a Promise

Promise-returning functions are hard to use when they sometimes throw synchronously; returning a rejected promise keeps failure handling consistent.

XHR is not JSON

request.xhr? is not a reliable signal for JSON responses in Rails; respond_to respects the client’s Accept header and supports both HTML and JSON.

RSpec: Efficiently rerunning failed examples during development

Persisting RSpec example status lets failed tests be rerun quickly during development with --only-failures or --next-failure.

Using Ruby's Method objects for inspecting methods

Ruby Method objects make it easier to inspect a method’s owner, signature, source, and definition site during debugging, especially when behavior changes across loaded code.

Use rbenv-each to run a command for every installed Ruby version

rbenv-each runs a command across every installed Ruby version, useful for updating global gems like bundler, rubygems, or other tools outside a Gemfile.

What collapsing margins are, how they work and when margins do not collapse

Adjacent vertical margins in CSS combine by taking the larger value, not the sum, which can create unexpected spacing or prevent consistent component layouts.

Be careful to use correct HTTP status codes for maintenance pages

Wrong status codes on maintenance pages can deindex sites or cache bad redirects. 503 Service Unavailable with Retry-After preserves SEO during temporary downtime.

Ag: Very fast grep replacement

ag is a fast text-search tool for source trees, honoring .gitignore and optional .ignore files for fewer matches and better performance.

Devise: How to send asynchronous emails

Devise mail is sent synchronously by default; deliver_later can log sensitive password reset tokens through ActiveJob. A custom mail delivery job disables argument logging.

Tasks, microtasks, queues and schedules - JakeArchibald.com

JavaScript timeout and promise callbacks can run out of queue order because tasks and microtasks follow different scheduling rules.

Restarting all God tasks

Restarting every process watched by God requires a full stop, terminate, and start cycle; god restart only performs a soft restart for one process or group.

Rails: Talking to the database without instantiating ActiveRecord objects

Direct SQL access can avoid the overhead of instantiating ActiveRecord objects, but skips validations, callbacks, and custom accessors.

How to work around selenium chrome missing clicks to elements which are just barely visible

Chrome/Selenium can miss clicks on barely visible elements when the click target is outside the viewport. A scrollIntoViewIfNeeded patch can work around the issue.

HTML: Auto fill-in OTP received in text message (SMS)

Browsers can autofill SMS one-time codes when inputs use autocomplete="one-time-code"; support is good in Chrome 93+ but absent in Firefox.

Upgrade Rails: Awareness list

Awareness list for Rails upgrades with version-specific pitfalls and workflow references, including production logging changes in Rails 7 and 6.