Quickly printing data in columns on your Ruby console
Print Ruby objects in aligned columns in the console for quick record comparison and attribute inspection.
Namespacing: why `uninitialized constant` error may occour in `development` but not in `test` environment
Namespaced Ruby classes can raise uninitialized constant in development when autoloading misses a nested class, while test may pass because everything is already loaded.
Execution of shell code in Ruby scripts
Deprecated Ruby ways to run shell commands can be unsafe or behave differently; capture3 is the preferred option for new code.
How to: Validate dynamic attributes / JSON in ActiveRecord
JSONB columns can hold dynamic attributes in ActiveRecord, but validation and strict defaults are easy to lose. JSON Schema keeps evolving hashes predictable.
Fix when assigning nested attributes raises "undefined method `to_sym' for nil:NilClass"
Nested attribute assignment can fail when a MySQL table lacks a primary key, triggering to_sym on nil. Adding a primary key index or setting self.primary_key = "id" fixes the lookup.
Debugging flickering VCR tests
VCR tests can flicker when recorded requests change because of randomness, timestamps, or generated sequences, making cassette mismatches hard to diagnose.
Performance analysis of MySQL's FULLTEXT indexes and LIKE queries for full text search
MySQL text search performance differs sharply between LIKE and FULLTEXT; LIKE stays surprisingly fast on medium datasets, while FULLTEXT benefits from larger vocabularies.
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.
Capturing signatures on a touch device
Touch-device signature capture for web forms with jQuery Signature Pad, plus server-side PNG generation from the stored stroke data.
Unpoly: Testing values for presence or blankness
Blank and missing values in JavaScript need explicit handling; Unpoly provides up.util.isBlank(), up.util.isPresent(), up.util.isMissing() and up.util.isGiven() for common and custom types.
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.
Find geocoded records that are close to a location (radius search)
Find records near a latitude/longitude pair by calculating distances in SQL or using acts_as_geocodable for radius-based queries.
UI Sortable on table rows with dynamic height
Table-row drag and drop in jQuery UI can misalign placeholder height and containment when rows auto-size to content; a small callback fix keeps reordering stable.
Manually uploading files via AJAX
Binary file uploads need FormData so AJAX can send multipart payloads from file inputs without manual serialization; older browsers often need a plain form fallback.
We are no longer maintaining Dusen
Dusen is no longer maintained; users needing query parsing and LIKE queries can migrate to Minidusen, while full-text indexing is better handled with PostgreSQL and pg_search.
Putting static content on Cloudfront
Static assets on CloudFront can speed up page loads, but cache invalidation, gzip handling, SSL, fonts, and mixed-content rules need careful handling.
Login forms: Disable browser prompt to remember the password
Browsers may prompt to save passwords on login forms; setting autocomplete="off" on the form suppresses that prompt.
"rake gettext:findpo" running forever
gettext_i18n_rails can enter a near-infinite loop during rake gettext:findpo when Haml strings mix escaped UTF-8 characters and #{} interpolation.
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.
Delete a Clearance session after some time of inactivity
Inactive users are logged out after a period without requests, using Clearance cookie expiration and a per-request refresh to keep active sessions alive.
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.
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.
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.