Ruby's default encodings can be unexpected

Plain Ruby strings can inherit inconsistent encodings from Encoding.default_external, causing incompatibility errors when text comes from StringIO, CSV, files, or IRB.

Ruby 2.3 new features

Ruby 2.3 adds safer nil handling, easier hash access, subset comparisons, numeric predicates, and negative filtering for cleaner collection code.

Download Ruby gems without installing

gem fetch downloads .gem files without installing them; dependencies are not included, so packages can be saved for inspection or offline use.

Ruby 2.3.0 has a safe navigation operator

Ruby 2.3.0 adds &. for nil-safe method calls, preventing NoMethodError when receivers can be absent while leaving false behavior unchanged.

Linux: Find out which processes are swapped out

Linux can move processes or even process parts into swap, which may affect performance. vm.swappiness controls how aggressively the kernel uses swap.

virsh reload xml config file

Reloading a libvirt domain configuration after XML edits avoids restarting libvirtd; virsh define reapplies the updated definition.

Ruby 2.3 brings Array#dig and Hash#dig

dig safely retrieves deeply nested values from hashes and arrays, returning nil when any part of the path is missing. Ruby 2.3 adds Array#dig and Hash#dig for this pattern.

Hack of the day: One-liner to run all Cucumber features matching a given string

Run only matching Cucumber feature files by searching .feature files for a string and passing the matches to geordi cucumber; similar xargs pipelines work without Geordi.

object-fit polyfill by lazysizes

IE lacks object-fit support, but lazysizes can polyfill image and video fitting with contain or cover behavior.

request_store: Per-request global storage for your Rails app

Per-request storage for Rails avoids leaking state between requests when using Thread.current; middleware clears data automatically at request end.

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.