How to make your git aliases work with both master and main

Git aliases can break when default branches differ between repositories. Using init.defaultBranch lets shared aliases adapt to master or main.

Spreewald: patiently blocks must not change variables from the surrounding scope

patently blocks must keep local variables inside the block; rebinding an outer variable breaks retries because later attempts reuse the changed value.

Signed URLs with Ruby on Rails

Temporary, tamper-resistant links can be built in Rails without extra database columns or conditional logic by using ActiveRecord's signed_id and .find_signed.

Finding a method name on a Ruby object

Search an object's method list when you only know part of a name; grep and method-set subtraction help isolate relevant public or private methods.

RubyMine's clipboard can hold more than one string

RubyMine keeps a clipboard history, letting you paste earlier copied strings instead of only the most recent one.

Ruby: Natural sort strings with Umlauts and other funny characters

Ruby string sorting misorders German umlauts, mixed case, and embedded numbers. to_sort_atoms, natural_sort, and natural_sort_by provide natural ordering.

Bundler 2.3 honors the version specified in `BUNDLED_WITH`

Bundler 2.3 respects the BUNDLED_WITH version in Gemfile.lock, preventing silent lockfile changes and installing the required version automatically.

Fixing Yarn 1 error "unexpected end of file"

Yarn 1 can fail with "unexpected end of file" during yarn install when registry downloads disconnect; increasing the network timeout or retrying can work around it.

How to read the current breakpoint tier(s) in JavaScript

Read the active viewport size in JavaScript by exposing a CSS custom property from media queries and retrieving it with getComputedStyle for responsive behavior.

How to develop designs for an enterprise customer

Enterprise design work can be derailed by late executive rejection despite lower-level approval; early mood designs and top-level sign-off reduce costly rework.

BigDecimal arithmetic in Ruby

BigDecimal avoids floating-point rounding errors in Ruby, especially for money and other exact amounts. Mixing it with Float turns results back into inexact values.

sessionStorage: Per-window browser storage

Temporary browser state survives reloads and accidental refreshes but stays separate for each tab or window; sessionStorage is string-only and not always available in private browsing.

Set default_url_options for entire Rails application

Set application-wide defaults for URL generation in Rails instead of duplicating them in multiple places as issues arise.

subscript, superscript and line-heights

<sub> and <sup> often break line height in email layouts; setting line-height: 0 with mso-line-height-rule: exactly keeps superscripts and subscripts consistent across clients.

Linux: Running a single unique instance of command + arguments

Prevents duplicate command instances with the same arguments from running at once, useful for cron jobs and other repeated tasks.

Destructors for async Unpoly compilers

Async Unpoly compilers cannot return destructors directly; up.destructor works, but detached elements can leak memory unless attachment is checked after await.

Bookmarklet: cards Markup Link Bookmarklet

Create Markdown links to cards in other decks with a bookmarklet that copies the current card title and path into link format.

Rails: Use STI in Migration

ActiveRecord migrations can break when STI models are referenced directly; embedding model classes in the migration and overriding find_sti_class and sti_name keeps type lookup working.

How to see how many inotify instances are used by each process

Many development tools consume inotify watches until the operating system limit is reached. A /proc scan identifies the process that uses the most watches so the limit can be raised or the culprit adjusted.

Diátaxis: A systematic framework for technical documentation authoring

A framework for organizing technical documentation around four user needs: tutorials, how-to guides, reference and explanation.

Jasmine: Creating DOM elements efficiently

Efficient ways to create DOM test fixtures for Jasmine, from HTML parsing and selector helpers to innerHTML, with readable structure and direct element references.

Advantages of using appname.daho.im:3000 over localhost:3000

Using separate local hostnames avoids cookie clashes and logouts when switching between web apps on Rails development servers.

Fast Navigation Tips In Dev Tools

Keyboard shortcuts and layout options in DevTools speed up panel switching, drawer visibility, and workspace organization.

Inspect and Debug CSS Flexbox and Grid Layouts by using the Layouts Tab in Dev Tools

Chrome DevTools Layouts tab helps inspect and tune CSS Flexbox and Grid with overlays, badges, and visual controls for sizing, alignment, and nested layouts.