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.
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.
Capybara: Execute asynchronous JavaScript
evaluate_async_script runs asynchronous JavaScript in Capybara and waits for completion, avoiding Selenium timeouts and allowing Ruby to receive results or error details.
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.
Do not use unitless zeros in CSS calc functions
Unitless zero values are invalid inside CSS calc() expressions, which can cause ignored declarations and missing or unpredictable layout behavior.
How to choose keyboard shortcuts for web applications
Custom keyboard shortcuts in web apps can clash with browser and OS defaults, making features hard to discover and use. Consistent, discoverable bindings improve efficiency without breaking expected behavior.
Variable fonts: Is the performance trade-off worth it? - LogRocket Blog
Variable fonts can reduce file loads and broaden typographic control, but performance gains depend on how many font styles a site needs.