Using ActiveRecord with threads might use more database connections than you think

ActiveRecord threads can open one database connection per thread, quickly exhausting server limits. Rails reuses and releases connections automatically, but manual cleanup is sometimes needed.

Unpoly: Passing Data to Compilers

Rails data can be passed to Unpoly compilers through data-* for simple strings and up-data for objects, arrays, and nested values.

Unpoly: Compiler Selector Patterns

Common Unpoly compiler selector strategies for reusable components, one-off view behavior, configurable attributes, and universal element enhancements.

Project management best practices: Budget control

Keeping project estimates aligned with the remaining budget prevents overruns when requirements change and project management overhead shifts.

Careful: `fresh_when last_modified: ...` without an object does not generate an E-Tag

Passing last_modified without an object skips ETag generation, so second-level timestamps can make distinct responses look identical and break cache-related tests.

Firefox cancels any JavaScript events at a fieldset[disabled]

Events from controls inside a disabled fieldset stop bubbling in Firefox, unlike Chrome and IE/Edge, which can break document-level listeners and delegated handlers.

SQL: Fast threshold counts with LIMIT

Large-table COUNT(*) queries can be slow when only a threshold like 100+ matters; a LIMITed subquery stops early and avoids scanning every row.

How to tweak RSpec's truncation behavior

RSpec truncates long inspected values to 200 characters, which can hide the real cause of failing specs. Raising max_formatted_output_length reveals more of the error message.

Matching Unicode characters in a Ruby regexp

Ruby 1.9+ \w and \d stay ASCII-only; Unicode-aware POSIX character classes match letters, digits, and other script-specific characters.

JavaScript: Stopping expensive work in inactive tabs

Pause expensive periodic work when a tab is hidden to save battery and mobile data; document.hidden and visibilitychange let background pages go passive.

zizmor - Static analysis for GitHub Actions

Static analysis for GitHub Actions workflow security and hardening finds unsafe interpolation, weak defaults, and unpinned actions; some warnings can be auto-fixed.

Rails 8: The db:migrate task might not run all migrations in db/migrate/ anymore

rails db:migrate on fresh databases now loads db/schema.rb or db/structure.sql first, which can skip data-manipulation migrations and leave state incomplete.

How to reliably center icons vertically with text

Icons and other inline blocks can be centered against capital letters instead of the text baseline. vertical-align with font metrics or 1lh gives a reliable result.

Ruby tempfiles

Temporary files in Ruby are removed automatically when no reference remains, and early unlink prevents stale paths and unauthorized access.

How to use pessimistic row locks with ActiveRecord

Concurrent requests can overwrite each other in Rails; pessimistic locking makes one transaction wait so only one update wins when a record is loaded or saved.

Testing HTTPS with badssl.com

Sites with unusual HTTPS setups help verify browser certificate handling, proxy interference, and security-product side effects.

ActiveType 1.2 supports "change_association"

ActiveType 1.2 allows modifying has_many and similar associations after definition, useful for form models that need custom record types.

Speed up your sass compile with sass-embedded

Sass compilation can be a build bottleneck. sass-embedded is a drop-in replacement for the deprecated sass package and is often about 50% faster.

How to change the time for a Docker container from the outside

Run a Docker container with a different perceived system time by injecting faketime via LD_PRELOAD and a mounted library path.

GoodJob: Ensure you get notified about background exceptions

ActiveJob and GoodJob can swallow exceptions, causing silent background job failures. Subscribing to job events and on_thread_error restores exception notifications and adds failure context.

Format your JavaScript with prettier

Opinionated formatting for JavaScript and TypeScript can remove whitespace debates and keep code consistent, with a small config and automatic reformatting.

Ruby: Avoiding errors when casting user input to Integers

User input often breaks integer conversion with exceptions or misleading zeros. Integer(..., exception: false) and ActiveModel type casting return nil instead.

Automatic Log Rotation in Rails

Rails log files rotate automatically around 100 MB, and config.log_file_size lets you cap growth and keep logs manageable in development, test, or production.

Checklist: Rails Authentication

Authentication is easy to get wrong because most users only sign in once. HTTPS with HSTS and a proven solution like Devise, Clearance or Rails primitives reduce security risks.