Git: Improve your commits by reviewing changes one-by-one

Git commits become safer when changes are reviewed and staged in small hunks, reducing accidental additions before committing.

Heads up: JavaScript does not like big numbers

JavaScript numbers lose precision above Number.MAX_SAFE_INTEGER, because values are stored as double-precision floats. BigInt handles arbitrary large integers.

CSS: The inset CSS shorthand

inset is a shorthand for top, right, bottom, and left, matching margin-style multi-value syntax for absolute positioning.

How to simulate limited bandwidth in Google Chrome and Firefox

Slow network conditions can be reproduced for web app testing with browser devtools or trickle, revealing issues on mobile and other constrained connections.

Ruby object equality

Ruby equality methods differ by purpose: == for value comparison, eql? and hash for hash keys, === for case matching, equal? for identity.

ActiveRecord: Cleaning up your database with ignored_colums

Unused database columns confuse teams and can linger safely while legacy access is phased out. ignored_columns removes Rails accessors and helps flag fields for later removal.

Debugging failed AJAX requests with better_errors

better_errors adds enhanced development error pages with a live REPL, and /__better_errors lets you inspect exceptions from AJAX requests.

Using partials in Rails views

Rails partials support locals, yield, layouts, collections, empty states, controller rendering, and cached collection rendering for reusable view markup.

Preloaded associations are filtered by conditions on the same table

Eager loading can unintentionally narrow has_many results when a where condition targets the joined table, even if the filter was only meant for the parent model.

Rails: namespacing models with table_name_prefix instead of table_name

Rails namespaces can share a table name prefix, avoiding repeated self.table_name settings for each model and keeping nested models aligned with naming conventions.

Calling a helper method with the same name as your current partial

Partials create a local variable from their own name, which can shadow a helper method with the same name. Calling it with self. lets the helper method be used inside the template.

How to create giant memory leaks in AngularJS (and other client-side JavaScript)

AngularJS client-side code can steadily accumulate unreclaimed objects until the browser process crashes. Common causes include forgotten listeners, timers, plugins, scopes, and unbounded caches.

Bash functions to provide repository context for LLM chats

Bash functions package repository context and Git diffs into XML files for Gemini chats, reducing copy-paste friction and API usage.

HTTP Client in RubyMine

RubyMine’s built-in HTTP client tests web APIs from .http scratch files, supports sequential requests, and can reuse response data with JavaScript variables.

Heads up: network requests `Kernel#open` are not mocked with VCR

Kernel#open and OpenURI#open_uri can still trigger real network requests in tests because VCR and WebMock do not mock them.

CSS: Don't target multiple vendor-prefixed pseudo-elements in a single rule

Comma-separated selectors fail when one pseudo-element is unknown; vendor-prefixed and standard forms must be written as separate CSS rules, or generated with a Sass mixin.

Logic of `where.not` with multiple attributes

where.not with multiple hash attributes uses NAND logic, excluding only records that match all conditions; chained calls behave like NOR and exclude matches to any condition.

HTTP headers can only transport US-ASCII characters safely

HTTP header values are limited to low-ASCII for safe transport; non-ASCII data such as Umlauts or emojis can be carried by JSON-escaping characters above 127.

Knapsack: Rerun a flaky test locally

Reproduce a flaky CI spec locally by rerunning the same Knapsack shard with the same seed and test order.

Beware: Many browsers define window.event

Some browsers expose window.event, but Firefox and recent IE versions do not. Passing the handler’s event object avoids cross-browser failures and accidental global access.

How to split up a git commit

Split one Git commit into several smaller commits by pausing an interactive rebase, undoing the commit, and recommitting selected changes.

How to explain SQL statements via ActiveRecord

ActiveRecord explain exposes database query plans for a scope, including joined or eager-loaded queries, in the database's native EXPLAIN format.

Always disable autocomplete for date pickers

Browser autofill can cover date picker popups and make them unusable. Disabling autocomplete on the trigger input keeps the calendar visible while preserving fallback behavior.

Canceling event propagation

Event propagation can be stopped in different ways, with distinct effects on default actions, bubbling, and handlers on the same element. jQuery’s return false combines prevention and propagation stop.