Using Responsive Images

Responsive images adapt to screen size and device capabilities, reducing bandwidth use and improving visual quality across phones, tablets, and desktops.

Web font rendering on Macs

Mac font rendering often appears too bold, especially on dark backgrounds; font smoothing settings can make text look lighter and sharper.

Stubbing terminal user input in RSpec

Console input tests are tricky because stubbing Kernel#gets often has no effect. Targeting the object or class that actually calls gets makes terminal input mocks work.

Testing terminal output with RSpec

Verify Ruby code that writes to the terminal by capturing stdout or stderr with RSpec expectations; heredocs help with multi-line output.

HAML 4+ expands nested element attributes

HAML expands nested hash attributes into prefixed HTML attributes, making component configuration with multiple options easier to read and write.

About IE's Compatibility mode

IE compatibility view can trigger quirks and rendering problems on older sites. X-UA-Compatible set to IE=edge helps force standards mode, but only when placed correctly.

How to test whether your device has a true Retina display

A simple visual test gauges how close a screen comes to true Retina quality by comparing fine line sharpness in two images.

instance_eval behaves different in Ruby 1.8 and Ruby 1.9, use instance_exec instead

instance_eval passes the receiver differently in Ruby 1.8 and 1.9, so lambdas can raise ArgumentError; instance_exec behaves consistently across Rubies.

factory_bot: Re-use partial factory definitions

Shared factory attributes and traits can be reused across FactoryBot definitions by extracting a trait and mixing it into multiple factories.

Rails Env Widget

A small helper adds a dismissible on-screen badge showing the current Rails environment to prevent confusion between development, test, and production.

Thunderbird add-on to manually sort accounts and folders

Extension for manually or automatically arranging Thunderbird folders in the folder pane, with account reordering support.

Ruby: Converting UTF-8 codepoints to characters

Convert UTF-8 codepoints and ASCII values to Ruby strings, or back to integers, with Integer#chr, String#ord, Array#pack, and String#unpack.

Lazysizes 2 is here

Lazy loading images and videos gains a faster release plus a plugin that polyfills object-fit and object-position for cleaner media layout in containers.

Bitmap to Vector Converter

Raster images can be turned into scalable vector graphics for sharper output and easier resizing. Auto-tracing software converts logos and artwork into EPS, SVG, or PDF.

How to find disabled fields with Capybara

Disabled form inputs can be hard to locate in Capybara when Selenium skips them; passing disabled: true makes them searchable.

Making jQuery throw an error when it returns an empty collection

jQuery selectors can silently return no matches; a tiny $.fn.ensure plugin throws an error when a collection is empty.

Dynamically uploading files to Rails with jQuery File Upload

Immediate multi-file image uploads in Rails with progress bars, previews, and cached attachments support a single gallery form and responsive UI.

UI Sortable on table rows with dynamic height

Table-row drag and drop in jQuery UI can misalign placeholder height and containment when rows auto-size to content; a small callback fix keeps reordering stable.

Javascript: Wait until an image has finished loading

Loading images asynchronously can race with rendering or size checks; ImageLoader.load() returns a promise that resolves with an HTMLImageElement once the image is ready.

PSA: When Redis (on LRU noeviction) reaches memory limits, keys with (any) expiry are removed, and keys without are not

Redis at maxmemory can evict expiring keys even before their TTL, while keys without a TTL stay until deleted and may trigger OOM errors.

jQuery: Find a selector in both descendants and the element itself

jQuery find ignores the current element and searches only descendants; findWithSelf returns matching descendants and the element itself.

Preloading images with CSS

Preloading hover or background images avoids visible delays when a new image is needed. Pure CSS can trigger loading without JavaScript.

Testing Cookie Limits

Browser cookie storage is constrained by per-domain limits on count and total size, which can break login or tracking data when limits are exceeded.

How to inspect RSS feeds with Spreewald, XPath, and Selenium

RSS feeds in Capybara can fail as XML inside the browser DOM; inspecting page source, using XPath, and opening the feed URL directly avoids false results.