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.
Rubymine: do not open last project
RubyMine can waste startup time by reopening the last project automatically, especially when switching between projects. Disabling that startup behavior and using the project chooser improves project switching.
Rails asset pipeline: Using ESNext without a transpiler
Modern browsers run most ES6 features natively, but Rails asset pipelines can still fail when Uglifier cannot minify newer syntax.
Ruby: Do not mix optional and keyword arguments
Mixing optional positional and keyword arguments in Ruby methods can turn hashes or to_hash objects into unexpected keywords and raise ArgumentError.
Caution: `.includes` can make `.ids` non-unique.
includes can duplicate primary keys in ids when loading associated records, causing unexpected non-unique results; preload keeps the ids list stable.
Organizing custom Date(Time) formats
Large Rails projects often duplicate date and datetime format strings, causing inconsistent output; named formats in Time::DATE_FORMATS and Date::DATE_FORMATS reduce repetition.
Sass: How to get rid of deprecation warnings in dependencies
Sass 1.35.0 can suppress dependency deprecation warnings with quietDeps and limit warnings in your own code with silenceDeprecations.
Using CSS transitions
Browser-native animations smooth UI state changes without JavaScript, with short durations and careful easing to avoid sluggish hover effects.
Everything you ever wanted to know about constant lookup in Ruby
Constant resolution in Ruby can be surprising when names are missing or resolved in an unexpected scope. Understanding lookup rules helps diagnose NameError and visibility issues.
What Sass means by "@function rules may not contain style rules."
Sass functions must return values; a computed line left unassigned or unreturned triggers @function rules may not contain style rules because Sass does not mutate objects.
Chrome DevTools: Event Listener Breakpoints
Chrome DevTools can pause code when browser events fire, making it easier to trace where clicks and other handlers are processed.
Chrome DevTools: DOM Breakpoints - Breakpoints on HTML Elements
DOM breakpoints in Chrome DevTools or Firefox Inspector help trace JavaScript that changes an element’s subtree, attributes, or removes it.
Stop writing "require 'spec_helper'" in every spec
Configure .rspec to load spec_helper or rails_helper automatically, avoiding repeated require lines in every spec and making parallel test setups work with .rspec_parallel.
Capybara: evaluate_script might freeze your browser
evaluate_script can freeze a browser window for about 10 seconds when it returns complex JavaScript objects; execute_script avoids the costly result conversion.