Debug your Postgres SQL query plan

Slow SQL queries can hide expensive scans and missed indexes; inspecting the PostgreSQL execution plan helps pinpoint bottlenecks and optimize query performance with explain and pev2.

How to disable telemetry for various open source tools and libraries

Telemetry and analytics in open source CLIs and frameworks often require explicit opt-out settings or environment variables to stop data collection and crash reporting.

How the Date Header Affects Cookie Expiration and Caching

Cookie expiry and HTTP cache lifetimes depend on the Date header when present; missing it can make mocked-time tests and browser caching behave inconsistently.

How to enable pretty IRB inspection for your Ruby class

Custom Ruby objects can gain colored, multiline IRB output by defining pretty_print; pretty_inspect is a simpler fallback when pretty printing is not needed.

DB enums are ordered

PostgreSQL enums keep a defined sort order, unlike string-backed columns whose collation can produce surprising results. Ordered enum values make priority fields behave predictably.

Capistrano task to edit staging / production credentials

Editing Rails credentials for staging or production requires server-only secret keys; a Capistrano task opens the decrypted file without copying keys to a dev machine.

Timeouts for long-running SQL queries

Database query limits prevent runaway SQL from consuming all resources; PostgreSQL statement_timeout and MySQL max_execution_time can cancel slow statements automatically.

A simple example with a GIN index in Rails for optimizing a ILIKE query

ILIKE searches in PostgreSQL can be slow without trigram indexing; a GIN index with pg_trgm can replace sequential scans with bitmap index scans.

Rails credentials: Always use the bang version

Missing secrets can stay unnoticed in some environments and break behavior later. Using ! on Rails.application.credentials and Rails secrets raises immediately when a value is absent.

Implementing a custom RuboCop cop

Project-specific RuboCop rules can flag conventions and stop the pipeline with little code, such as banning TODO and WIP comments in Ruby files.

Compare library versions as "Gem::Version" instances, not as strings

String comparison can misorder gem and Ruby versions, letting newer releases slip past checks; Gem::Version gives reliable semantic version comparisons.

Rails npm packages will use an uncommon versioning scheme

Rails npm packages need a version mapping from 4-part gem releases to npm’s 3-part semver, so package ranges keep working across patch and prerelease builds.

Ruby: Different ways of assigning multiple attributes

Ruby classes with many fields can become hard to instantiate or validate. Options range from positional and keyword arguments to ActiveModel::Attributes, Struct, hashes, and OpenStruct.

Rails I18n scope for humanized attribute names

Custom attribute labels in Rails can be stored in locale files and reused by human_attribute_name and error messages instead of duplicating names in code.

Unpoly + Nested attributes in Rails: A short overview of different approaches

Rails nested attributes become cumbersome with dynamic subrecords; Unpoly enables friendlier add/remove workflows without losing server-side validation and form helpers.

Rails: Different flavors of concatting HTML safe strings in helpers

Different ways to build HTML-safe markup in Rails helpers affect readability, buffering, and XSS safety. concat, safe_join, capture, and html_safe each behave differently.

Using rack-mini-profiler (with Unpoly)

Rails performance debugging often hides slow SQL, view rendering, and N+1 queries; rack-mini-profiler helps surface bottlenecks during development.

Rails 7.1: Take care of the new production log default to standard out

Rails 7.1 changes production logging to standard out, which can break file-based logs in opscomplete setups unless the previous logger configuration is restored.

Rails: Testing file downloads with request specs

File downloads are slow and fragile to test through Capybara. Request specs make exports fast, stable, and easy to verify, with a small end-to-end check for the link.

Chaining Capybara matchers in RSpec

Chaining Capybara matchers with and retries the full expectation when one check fails, making multiple assertions more reliable on pages that change asynchronously.

You should be using the Web Animations API

Browser support is strong for the Web Animations API, which lets JavaScript animate DOM elements and await or cancel CSS transitions and animations.

Be careful when checking scopes for blankness

blank? on an ActiveRecord::Relation can load every row into memory and stall workers; use nil checks or exists?/empty? for cheap scope checks.

Use <input type="number"> for numeric form fields

Numeric form fields on mobile get digit-focused keyboards, locale-aware decimal display, and consistent point-based values in JavaScript and form submission.

How to configure Selenium WebDriver to not automatically close alerts or other browser dialogs

Selenium WebDriver dismisses browser dialogs by default and can close alerts before tests react. Setting unhandled_prompt_behavior to ignore leaves prompts open until handled.