Consul 1.3.0 lets you override generated controller methods
Consul 1.3.0 allows overriding generated controller methods mapped with :as, while super preserves the original implementation for added scope conditions.
Fixing wall of net/protocol warnings
Rails boot warnings from duplicate net-protocol constants after upgrading can be silenced by avoiding automatic loading of net-http, net-imap, net-protocol, and net-smtp.
Why Sidekiq Jobs should never be enqueued in an `after_create` or `after_save` callback
Database transactions can roll back after after_save, leaving Sidekiq jobs queued for records that never persist. after_commit runs after persistence and avoids this race.
Heads up: expect(object).to receive(:method_name) does not execute the original implementation of the method
receive(:method_name) stubs the original method implementation, so callbacks or side effects do not run during expectations. and_call_original preserves the real behavior.
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.
Rails: Passing array values to tag helpers like link_to
Array values in Rails HTML options become space-separated strings, making class helpers accept multiple CSS classes without manual joining.
Carrierwave: always limit images to a reasonable size
Large camera uploads can reach tens of megabytes and should usually be reduced to a practical resolution before storage or delivery.
Don't mix Array#join and String#html_safe
Mixing safe and unsafe HTML strings with Array#join breaks Rails output safety and can trigger incorrect escaping or unsafe rendering.
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.