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.
How to combine greps on log files opened with tail -f
Chaining grep with tail -f needs --line-buffered, otherwise matches may not appear immediately in a pipeline.
How to revert features for deployment, merge back, and how to stay sane
Feature reverts can block deployment when unfinished work must stay out of production; consolidating reverts into a few commits makes restoring them after release easier.
Making ZSH the default shell on Ubuntu 20.04
ZSH can replace Bash on Ubuntu 20.04 and adds command-line conveniences like completion, corrections, themes, and plugins.
Linux: Create file of a given size
Create a file with an exact target size on Linux for testing or temp data, using dd or zero-filled writes.
HTTPie nice command line HTTP client
http is a simple command-line client for debugging and testing HTTP servers, REST APIs, and web services with readable defaults and colored output.
Geordi 1.2 released
Geordi 1.2 adds more flexible deploys, better Cucumber reruns and debugging, and reorganized Firefox and VNC command handling.
Structuring Rails applications: the Modular Monorepo Monolith
Monolithic Rails apps can stay maintainable by splitting code into a monorepo of Rails Engines and gems with explicit component dependencies.
Using local fonts with Webpack / Webpacker
Using self-hosted or purchased fonts with Webpack or Webpacker requires either bundling them from assets or packaging them locally for clean imports.
MongoMapper for Rails 2 on Ruby 1.9
MongoMapper support for Rails 2.3.x on Ruby 1.9 via a forked gem branch; compatible with Ruby 1.8.7, REE, and Ruby 1.9.3.
Ruby: Writing specs for (partially) memoized code
Memoized ActiveRecord values can stay stale in specs even after reload; re-finding the record or clearing memoization avoids false failures.
The new Modularity 2 syntax
Modularity 2 replaces does with include-based traits and new naming rules, with automatic migration support for existing Ruby projects.
rspec_candy 0.2.0 now comes with our most popular matchers
rspec_candy 0.2.0 adds matchers for tolerant number comparison, second-level time equality, and hash subset matching in RSpec.
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.
Synchronize a Selenium-controlled browser with Capybara
Selenium actions can return before a page finishes loading, so Ruby updates may race with browser-side changes. A Capybara resynchronization step prevents flaky Cucumber features.
xdissent/ievms - GitHub
Run multiple Internet Explorer versions in separate VirtualBox VMs on Linux or OS X for website testing without Microsoft VirtualPC.
Running Rails 2 apps with modern MariaDB SQL server
Rails 2 apps can break on MySQL 5.7; MariaDB 10.x is a compatible replacement for old and new applications, with gem rebuilds sometimes needed after switching.
RSpec: Defining helper methods for an example group
Helper methods can be defined inside an RSpec example group and inherited by nested groups, but not by parent or sibling groups.
Capistrano 2: How to deploy a single server
Deploy a single server from a multi-server Capistrano setup by using HOSTFILTER to target one host and skip irrelevant tasks.
Silence specific deprecation warnings in Rails 3+
ActiveSupport deprecation warnings can be selectively hidden when a specific warning cannot be fixed and only certain messages should stay visible.
RSpec: ". not_to include" behaves like ".to exclude"
not_to include with multiple values checks each value separately, so one matcher can verify several exclusions at once instead of negating the whole expectation.
Usage of RSpec's raise_error
raise_error without an expected exception can pass for unrelated bugs, so matching a specific error class and message makes specs meaningful.
Silencing Your Staging Environment - The Hashrocket Blog
Production data testing can accidentally email real users; rewriting recipient domains in ActionMailer prevents staging mail from reaching live inboxes.
DOM API for jQuery users
Quick reference for replacing common jQuery DOM tasks with native browser APIs and handling event delegation gaps without jQuery.