RSpec 3 argument constraints use weak equality
RSpec 3 argument matching can accept broader values than strict equality, especially for classes, regexps, and ranges. Use eq or a block for exact expectations.
Rails < 5: How to get after_commit callbacks fired in tests
Transactional test fixtures can suppress after_commit callbacks in Rails, preventing email jobs and other post-save work from running. Rails 5 fixes this; older versions can use test_after_commit.
ActiveRecord: Creating many records works faster in a transaction
Bulk inserts into one table can be much faster inside a transaction; Rails 6+ also offers insert_all for a single multi-row INSERT without validations.
Local deployment after pipeline succeeds
CI-only workflows can delay local deployments until a commit lands on the branch. A shell alias can wait for the next update and trigger cap staging deploy automatically.
How to configure case insensitive git output
Git diff output uses less, and repeated case-insensitive searches are easier when less -i is configured globally.
Geordi 9.6.0 released: new "did you know?" feature
Geordi suggests related commands and options after successful runs, surfacing hand-picked hints with a low random probability.
Find Where a Rake Task is Defined
rake --where reveals the source file and line that define a task, useful for tracing where assets:precompile comes from.
Vim: Simple way to edit several lines at once at the same cursor position
Column editing in Vim lets the same change be applied to several lines at one cursor position. Ctrl+v visual block mode and insert mode make repeated edits fast.
Capo: putting <head> content into the right order
Head element order can affect perceived page performance, and Capo helps identify out-of-order elements and suggest a faster arrangement.
Linux: How to make a terminal window title reflect the current path
Terminal emulators can show unhelpful titles like the shell name instead of the current directory. Bash and Zsh can update the window title automatically with an escape sequence.
About Ruby's conversion method pairs
Ruby distinguishes explicit and implicit conversion methods; implicit ones like to_hash should only be implemented when an object already behaves like the target type.
Git diff: Deemphasizing code that was only moved around
Long diffs can hide real edits inside large code moves; git diff --color-moved=dimmed-zebra dims unchanged moved lines and highlights changes.
Testing shared traits or modules without repeating yourself
Shared behavior in traits or modules can be tested once with RSpec shared example groups instead of duplicating specs for each class.
How to: Run bundle install in parallel
Parallel bundle install speeds up gem installation during development when switching projects often; bundle config jobs sets the number of worker processes.
ss: How to show listening ports
ss lists open TCP and UDP ports and the processes bound to them, making it easier to find what is listening on a local machine.
Raising JavaScript errors in Ruby E2E tests (RSpec, Cucumber)
Selenium E2E tests can miss frontend JavaScript errors because browser console logs do not fail specs by default. BrowserConsole raises on console errors and supports ignore rules.
Don't assert exceptions in feature specs
Capybara feature specs do not reliably catch server exceptions in another thread; request specs or visible UI assertions fit this user-level behavior better.
How to pretty print all values in a Redis database
Print every Redis key and value to the console for debugging, handling strings, hashes, lists, sets, and sorted sets with a Ruby script.
Better HTML forms: use type, inputmode, enterkeyhint and autocomplete
HTML form usability improves with type, inputmode, enterkeyhint, and autocomplete, giving better mobile keyboards, clearer enter actions, and smarter browser autofill.
Byebug cheatsheet
Quick reference for byebug debugging commands, breakpoints, stack navigation, variable inspection, and thread control.
Bundler in deploy mode shares gems between patch-level Ruby versions
Patch-level Ruby updates can break native gems when Bundler shares bundles across 2.6.x versions, leaving failed deploys with incompatible extensions.
Ruby: Referencing global variables with the built-in English library
Ruby’s special global variables are harder to read and can fail without require 'English', especially in Rails where the library is not loaded by default.
How to write modular code
Reduce spaghetti code by splitting behavior into focused functions, service classes, form models, and value objects, while avoiding long parameter lists and excessive DRY.
How to open files from better_errors with RubyMine on Linux
RubyMine rubymine:// links can fail on GNOME/Linux, blocking better_errors from opening source files in the editor. A custom desktop handler and BETTER_ERRORS_EDITOR_URL make file jumping work.