Speed up your websites: Put JavaScripts at bottom
Placing JavaScript at the end of the page lets content render sooner in non-client-side apps, reducing perceived load time while keeping scripts centralized.
Error handling in DOM event listeners
DOM event handler exceptions are swallowed, so later listeners and dispatchEvent() continue running. Uncaught errors still reach the browser log and window error event.
RubyMine: Efficiently filtering results in the "Finder" overlay
RubyMine Finder searches can return huge result sets; file masks, directory limits, regex, and other filters narrow matches and speed up locating the right code.
Rails: Fixing ETags that never match
Rails default ETags often never repeat because rotating CSRF tokens and CSP nonces change response bytes, blocking cache hits and 304 responses.
CI Template for GitHub Actions
GitHub Actions CI template for Rails apps with parallel RSpec, RuboCop, ESLint, license checks, security scanning, and merged coverage reports.
Chaining Capybara matchers in RSpec
Chaining Capybara matchers with and retries the full expectation when one check fails, making multiple assertions more reliable on pages that change asynchronously.
HTML file inputs support picking directories
Directory uploads are possible with <input type="file" webkitdirectory multiple>, letting users select a folder and its nested files instead of choosing individual files.
HTTP headers can only transport US-ASCII characters safely
HTTP header values are limited to low-ASCII for safe transport; non-ASCII data such as Umlauts or emojis can be carried by JSON-escaping characters above 127.
Capybara: Preventing server errors from failing your test
Capybara can fail tests after all steps when the Rails server raises an error on session cleanup. Filtering known missing-file errors avoids false failures.
Vortrag: Content Security Policy: Eine Einführung
Content Security Policy schützt Webseiten vor XSS, indem der Browser erlaubte Quellen für Skripte, Styles, Bilder und Verbindungen streng einschränkt.
IE11: Trigger native mouse events with Javascript
IE11 needs real DOM mouse events for code that listens to native handlers as well as jQuery .on; synthetic clicks from trigger are not enough.
Mock the browser time or time zone in Selenium features
Selenium browser tests see real system time unless the client clock is patched; timemachine.js and Timecop keep browser time aligned, while TZ can align the process time zone.
HTML5: disabled vs. readonly form fields
Noneditable HTML form controls behave differently with disabled and readonly: submission, focus, and tab order change, and browser quirks can affect fieldset descendants.
Rails asset pipeline: Why relative paths can work in development, but break in production
Relative asset URLs can work in Rails development but break after assets:precompile, because files are merged into public/assets and fingerprinted.
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.
Things you probably didn’t know you could do with Chrome’s Developer Console
Useful Chrome DevTools console tricks for editing pages, timing code, inspecting elements, and reusing previous results.
Efficiently add an event listener to many elements
Attaching one listener to many elements can slow the browser; delegating to document reduces setup cost and suits low-frequency events like click.
Better numeric inputs in desktop browsers
Desktop number fields accept scientific notation, arrow-key changes, wheel scrolling, and stray letters, causing accidental edits and validation errors.
Use CSS "text-overflow" to truncate long texts
Single-line text can overflow its container in Rails views; text-overflow: ellipsis and white-space: nowrap produce cleaner truncation in supported browsers.
Migration from the Asset Pipeline to Webpacker
Moving a Rails app from the Asset Pipeline to Webpacker requires inventorying bundled libraries, repackaging legacy assets, and adjusting deployment for pack-based assets.
Livereload + esbuild
Live CSS and JS reloading in Rails with esbuild is awkward because generated assets change on every build. A guard-livereload plus livereload-js setup can avoid full-page reloads for stylesheet changes.
Clean up application servers when deploying
Frequent deployments fill application servers with old releases, tmp files, and stale compiled assets. Capistrano can automate release and asset cleanup to prevent disk-space exhaustion.
Passive event listeners may speed up your scroll and touch events
Passive listeners let the browser keep scrolling responsive by not waiting for touch or wheel handlers that never cancel default behavior.
Threads and processes in a Capybara/Selenium session
Capybara/Selenium tests involve a test process, a server thread and a browser process, so blocking, stale time, and uncommitted transactions can cause seemingly impossible failures.