How to combine unknown CSS selectors

Combining unknown CSS selectors safely fails when a selector list appears; :where() and :not() preserve correct matching without breaking lists.

JavaScript: Listening to a class getting added

Detecting when a CSS class is added can be done with a MutationObserver, useful for reacting to DOM state changes on selected elements.

How to ask a (mobile) browser about the true visual viewport

Pinch-zoom, the on-screen keyboard, and other overlays can shift the actually visible page area beyond the layout viewport. VisualViewport exposes the visible region for positioning and tracking.

How to start Terminator with split screens and custom commands running

Start Terminator with split panes and predefined commands while keeping shells open after the command exits.

JavaScript: Testing the type of a value

JavaScript value checks are inconsistent across primitives, objects, arrays, null, undefined, and NaN; the right test depends on whether you need type, instance, or property presence.

How to Work With Time Zones in Rails

Rails uses configurable time zones, while Ruby time APIs follow the server zone and can return wrong results. Time.zone keeps date and time handling consistent.

Avoiding Test-Case Permutation Blowout - Steven Hicks

Business-rule tests with multiple variables can explode into 2n permutations. An n+1 pattern keeps coverage manageable while making individual cases easier to follow.

A gotcha of Ruby variable scoping

Ruby local variables are visible after conditional branches, so a missing assignment can yield nil instead of an error and silently produce blank output.

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.

How to write complex migrations in Rails

Complex Rails schema changes need SQL, embedded migration models, or adapter helpers when simple add_column and update calls cannot handle existing data safely.

Working on the Linux command line: Use the `tree` command instead of repeated `cd` and `ls`

Directory trees are easier to inspect with tree than repeated cd and ls, especially for nested structures. Depth limits and shell aliases keep output manageable.

Your browser might silently change setTimeout(f, 0) to setTimeout(f, 4)

Nested zero-delay timers are clamped by browsers, so repeated setTimeout(f, 0) calls can run several milliseconds late, especially in background tabs.

How to speed up JSON rendering with Rails

Slow Rails JSON endpoints often waste time in JBuilder, loading full records, and Ruby object allocation. pluck, database aggregation, and cached materialized views can cut response time dramatically.

RubyMine: Adjust Code Templates

RubyMine test file generation can produce excessive boilerplate, and file templates let you tailor the output to project needs.

Protected and Private Methods in Ruby

Ruby method visibility differs from Java: private allows only implicit calls, while protected permits access between instances of the same class or subclasses.

Advisory: Excel converts CSV entries to formulas

Spreadsheet apps can interpret CSV cells beginning with =, +, -, or @ as formulas, turning exported user input into a security risk.

How to: Ensure proper iconfont rendering with Webpack

Custom icon fonts can render as garbled characters after switching from Sprockets to Webpack because CSS charset detection changes. Adding a UTF-8 BOM or an explicit charset can prevent intermittent display failures.

How to query GraphQL APIs with Ruby

GraphQL APIs return nested data through one endpoint, and Ruby can query or mutate them with plain HTTP requests without adding graphql-client.

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.

JavaScript: Humanizing durations

Format durations into the nearest human-readable unit with locale-aware pluralization using Intl.NumberFormat, defaulting to German.

Use the Git stash without shooting yourself in the foot

git stash apply leaves entries in place, so later stashing can restore the wrong changes; git stash pop applies and removes the top stash entry.

Too many parallel test processes may amplify flaky tests

Flaky test suites can fail more often with too many parallel workers; limiting PARALLEL_TEST_PROCESSORS can reduce race-condition failures with only a small runtime cost.

Ruby: Retrieving and processing files via Selenium and JavaScript

Selenium can fetch binary files through JavaScript and return them to Ruby as an array, useful when direct downloads are awkward or blocked.

Cheat Sheet for the modern DOM API

Quick reference for native DOM methods and properties that replace many jQuery calls, helping you find equivalents without browsing Element interfaces.