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.
JavaScript: Polyfill native Promise API with jQuery Deferreds
Small Promise polyfill for jQuery projects, trading native API compatibility for tiny size and jQuery Deferred performance limits.
Minimal JavaScript function to detect version of Internet Explorer or Edge
User-agent sniffing can still be necessary when Microsoft browsers need special handling. ieVersion() extracts Internet Explorer 10/11 and Edge version numbers, returning undefined for others.
Implementing social media "like" buttons: Everything you never wanted to know
Embedding social widgets can expose cookies, trigger background tracking, and slow pages; privacy-friendly two-step buttons and async loading reduce the impact.
CSS & a11y: When hiding with opacity, also set visibility:hidden (transitions supported)
Opacity alone hides only visually, leaving elements focusable and exposed to screen readers. Pairing it with visibility:hidden keeps fade transitions smooth and accessibility intact.
VCR fails if the same request is triggered multiple times
VCR records each request only once, so replaying repeated identical calls can fail unless allow_playback_repeats is enabled.
The TCF 2.0 (Tranparency and Consent Framework) standard, and what you should know about it
GDPR-compliant ad consent requires a registered CMP, consent strings, and __tcfapi so vendors can verify user choices before serving personalized ads.
Bookmarklet to generate a commit message for an issue in Linear.app
Issue-linked commit messages need a ticket ID prefix; a bookmarklet can prefill the correct [ID] title format from a Linear issue view.
How to transition the height of elements with unknown/auto height
Collapsing dynamic content cannot animate height: 0 to height: auto; a grid row transition between 0fr and 1fr provides a modern CSS workaround.
How to work around selenium chrome missing clicks to elements which are just barely visible
Chrome/Selenium can miss clicks on barely visible elements when the click target is outside the viewport. A scrollIntoViewIfNeeded patch can work around the issue.
Introduction to Google Tag Manager (for web developers who know Google Analytics)
Configuring analytics without code changes keeps tracking flexible, but GTM adds complexity and security risk. Tags, triggers, and variables centralize event and pageview tracking.
Jasmine: Use `throwUnless` for testing-library's `waitFor`
Flaky waitFor tests can fail when Jasmine expectations do not throw, preventing retries. throwUnless and throwUnlessAsync turn failed checks into exceptions for reliable waiting.
WYSIWYG with Action Text
Rails 6 Action Text provides a built-in WYSIWYG editor for rich text fields, with Trix hooks for custom toolbar buttons and attachment handling.
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.
jQuery: Work with text nodes and comment nodes
contents() returns all child nodes, including text and comment nodes, and filter() can isolate non-element nodes by nodeType.
Rails: Flagging all cookies as secure-only to pass a security audit
Secure cookies are often required by audits even when a Rails app already uses HTTPS and HSTS. A middleware can add the Secure flag to server-set cookies automatically.
How to migrate CoffeeScript files from Sprockets to Webpack(er)
Migrating CoffeeScript from Sprockets to Webpacker can keep existing classes and dependencies working by adding coffee-loader and adjusting imports and global namespace exposure.
A gotcha of Ruby variable scoping
Ruby local variables are visible after conditional branches, so a missing assignment can yield nil instead of an error and silently produce blank output.
How to: Specify size of Selenium browser window
Set a consistent browser viewport for Selenium tests to avoid layout-dependent failures and mobile-versus-desktop behavior differences.
In Chrome 121+ the now supported spec-compliant scrollbar properties override the non-standard `-webkit-scrollbar-*` styles
Chrome 121+ gives scrollbar-width and scrollbar-color precedence over ::-webkit-scrollbar-*, so existing scrollbar styling can regress unless CSS is gated by browser support.
Fixing authentication in legacy applications
Legacy authentication setups often miss SSL, cookie, CSRF, and session-fixation protections, leaving logins and browser-stored data easy to compromise.
Testing regular expressions visually
Complex regex patterns are hard to debug by inspection; visual editors highlight matches and capture groups to make validation easier.
A collection of graph and diagram tools
Tools for plotting graphs and diagrams in Ruby, plus browser-based and offline options for visualizing flows, state machines, and scientific data.
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.