Yarn: How to recognize that you are using a different node version than your colleagues
Mismatched Node.js versions can trigger Yarn integrity errors and unexpected node_modules changes, especially when dependencies are committed or .nvmrc is missing.
Webpack: Automatically generating an icon font from .svg files
Vector icons are easy to use but tedious to build; webpack plugins can automate SVG-to-icon-font generation and keep icons aligned, scalable, and JavaScript-free.
Cucumber does not find neither env.rb nor step definitions when running features in nested directories
Feature files in nested directories can stop Cucumber from loading env.rb and step definitions unless the features directory is required explicitly.
How to: Client-side language detection
Client-side language detection can route visitors to their preferred locale on the root path without a server-side component, with JavaScript and a meta refresh fallback.
Best practices for REST API design
REST API design often fails on timestamps, number handling, pagination, filtering, and versioning. Consistent conventions improve interoperability and client stability.
Test downstream bandwidth of Internet connection
Check whether an internet uplink can sustain 1GE or 10GE throughput by pushing traffic internally or from many public mirrors.
Mysql::Error: SAVEPOINT active_record_1 does not exist: ROLLBACK TO SAVEPOINT active_record_1 (ActiveRecord::StatementInvalid)
Parallel test runs can trigger missing-savepoint rollback errors when processes share a database or transactional test settings conflict.
Simple form examples with bootstrap
Building Bootstrap forms with simple_form reduces repetitive markup and keeps form layouts consistent.
Fix Rubygems binary error: undefined method `activate_bin_path' for Gem:Module (NoMethodError)
Rubygems version mismatches can break generated executables with undefined method activate_bin_path after downgrades. Reinstalling gem executables with gem pristine --all or reinstalling RubyGems and Bundler restores working binstubs.
Workaround for broken integer division after requiring the mathn library
mathn can silently replace integer division with exact rationals across a Ruby project. A workaround limits the monkey patch to code that explicitly needs exact division.
Ruby < 2.4: Downcasing or upcasing umlauts
downcase and upcase on umlauts and accented letters stay unchanged in Ruby before 2.4, causing failed string comparisons. ActiveSupport::Multibyte::Chars handles Unicode case conversion correctly.
Saving application objects in your session will come back to haunt you
Storing application objects in sessions can trigger ActionController::SessionRestoreError after class removal or deployment. Keep session data to strings and numbers, or provide stubs for old classes.
How to drop all tables in PostgreSQL
Removing every table while keeping the PostgreSQL database can be done by dropping the schema or iterating through tables with DROP TABLE statements.
Subclassing module
Ruby module subclassing injects state and defines accessors when included, enabling trait-like macros and partial classes for cleaner model organization.
rsl/stringex ยท GitHub
Ruby string extensions for turning text into URL-friendly slugs, with Unicode handling and locale-aware replacements for symbols and HTML entities.
VCR and the webdrivers gem
VCR can complain when webdrivers checks the internet for driver updates during tests. Updating locally, ignoring the update host, or pinning the driver version avoids the noise.
Ruby's default encodings can be unexpected
Plain Ruby strings can inherit inconsistent encodings from Encoding.default_external, causing incompatibility errors when text comes from StringIO, CSV, files, or IRB.
How to preview an image before uploading it
Live image previews in file upload forms improve user feedback before sending files to the server, using URL.createObjectURL with img tags or Unpoly compilers.
Middleman does not fingerprint asset paths by default
Middleman static sites serve stable asset URLs by default, so cached JavaScript and CSS can stay outdated. :asset_hash adds fingerprinted paths to force cache refreshes.
Ruby 2.3 new features
Ruby 2.3 adds safer nil handling, easier hash access, subset comparisons, numeric predicates, and negative filtering for cleaner collection code.
Unexpected behavior when changing both an association and its foreign key attribute in ActiveRecord
Changing an association and its foreign key on the same ActiveRecord object can lose the later assignment; the association value wins on save.
Measuring sql query time of a piece of code using ActiveSupport::Notifications
Measure database time for a Ruby code block by collecting sql.active_record events and summing their durations with ActiveSupport::Notifications.
Install a local Gemfile on a remote server
Run bundle install on a remote host using a local Gemfile, even for vendored gems or a different BUNDLE_GEMFILE.
How to encode or decode quoted-printable strings
Quoted-printable mail encoding turns characters like = into escape sequences and may wrap long lines. Ruby can decode and encode it with unpack('M') and pack('M').