ActiveRecord meets database views with scenic
Use SQL views in a Rails app without switching the schema format to SQL; Scenic adds versioned, reversible migrations and keeps view definitions in SQL files.
You can use any RSpec matcher to match arguments of method calls
RSpec method expectations can match arguments with any matcher, not just anything or hash_including, making loose argument checks more expressive.
Beware: Nested Spreewald patiently blocks are not patient
Nested patiently blocks in Spreewald can disable retries by setting inner wait times to zero, causing flaky Cucumber/Selenium steps.
Enabling view rendering for controller specs
Controller specs usually skip template rendering; integrate_views in RSpec 1 or render_views in RSpec 2 enables view rendering for specs that need it.
The Easiest Way to Parse URLs with JavaScript
Parsing URLs is simpler with an <a> element than with new URL(...), and it also handles incomplete relative paths; IE11 may omit the leading slash.
Force SSH client to use password authentication instead of public key
Password authentication can be tested by forcing SSH to skip public key login and prefer passwords. The same options also work with scp for file copies.
VNC browser disappears while typing
Typing d in a Geordi VNC browser can switch to a grey screen; pressing d again brings the browser back.
Testing regular expressions visually
Complex regex patterns are hard to debug by inspection; visual editors highlight matches and capture groups to make validation easier.
How to silence UTF-8 warnings on Rails 2.3 with Ruby 1.9
Ruby 1.9 triggers UTF-8 regexp warnings in Rails 2.3.16+ from ActiveSupport; a monkey patch in config/initializers suppresses them.
How to set the default monospace font on Xfce (Xubuntu)
Applications that use the generic Monospace family ignore terminal font settings. A fontconfig override in ~/.fonts.conf can map it to a preferred font.
Change how Capybara sees or ignores hidden elements
Capybara’s default hidden-element handling affects DOM queries globally, while :visible scopes visibility checks to one lookup. Driver-specific visibility rules differ between RackTest and Selenium.
Use byebug on Ruby 2+
debugger is unreliable on Ruby 2; byebug provides a fast, reliable debugger for Ruby 2.0.0+ using TracePoint and Debug Inspector.
Rails: How to stub the env in Rails 7+
Rails 7.1 adds Rails.env.local?; stubbing Rails.env with a plain string can fail, while ActiveSupport::EnvironmentInquirer keeps environment checks working.
Project maintenance: four levels of code quality
Code quality determines maintainability, from merely working code to reliable, readable, and changeable code. Long-lived projects need at least readable code; short-lived code can stop at reliable code.
Cucumber's table diffing does not play nice with Spreewald's `patiently do`
Cucumber::MultilineArgument::DataTable#diff! caches state, so repeated checks inside patiently do keep failing; expected_table.dup.diff! avoids the stale comparison.
Testing Cookie Limits
Browser cookie storage is constrained by per-domain limits on count and total size, which can break login or tracking data when limits are exceeded.
RSpec: Expect one of multiple matchers to match
RSpec allows chaining matchers with .or, so an expectation passes when any one matcher matches. Useful for Capybara checks across different button renderings.
Ruby: Reading and writing CSVs
Ruby can read and write CSV files with the standard CSV library, and smarter_csv makes imports more convenient when converting rows into hashes.
Geordi hints
Quick Geordi command shortcuts for guided deployment, setup, security updates, tracker-based commits, and matching ChromeDriver installation.
Sentry Local Logging in Ruby
Local Sentry event logging helps debug error capture and background jobs without sending data to Sentry or affecting production metrics.
Random list of ActiveSupport goodies
Handy ActiveSupport helpers add callbacks, message signing and encryption, ordered options, array wrapping, deep hash merging, whitespace squishing, and zone-aware current time.
Know what makes your browser pant
Changing CSS properties can trigger different amounts of browser work, affecting performance when styles are updated.
How much should I refactor?
Balancing refactoring with complexity is difficult when new patterns promise cleaner, more testable Rails code. Choosing when to apply them keeps code maintainable without overengineering.
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.