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.
Subclassing module
Ruby module subclassing injects state and defines accessors when included, enabling trait-like macros and partial classes for cleaner model organization.
Angular with haml: Dynamic html classes
Haml mangles Angular 1 dynamic class attributes and can trigger [$parse:syntax] errors. Use ng-class or avoid Haml class interpolation.
How to monitor Sidekiq: A working example
Sidekiq monitoring needs a JSON status endpoint for queue sizes, worker activity, and recent failures. A cron-triggered heartbeat job and Redis timestamps let external checks detect stalled background processing.
Understanding AngularJS service types
AngularJS service kinds differ in configurability, injection style, and object shape; factories are usually the default choice, while providers support configuration and decorators extend existing services.
mceachen/closure_tree: Easily and efficiently make your ActiveRecord models support hierarchies
closure_tree adds hierarchical tree support to ActiveRecord models with efficient reads, pre-ordered trees, and safer concurrent updates than ancestry.
AngularJS: How to remove a watch
AngularJS -watch registrations can be removed after a condition is met, avoiding unnecessary change detection once a scoped value appears.
How to inspect really large directories
ls becomes slow in very large directories because it sorts names and formats columns before printing. Disabling both yields immediate streaming output.
Repeatedly execute a bash command and observe its output
Run a command at regular intervals and watch its output update, useful for monitoring changing files or other live system state with watch.
How to "git diff" with a graphical diff tool
Use git difftool to open diffs in a graphical viewer like Meld when the terminal diff is not enough.
tesseract.js: Pure Javascript OCR for 62 Languages
Browser-based OCR for scanned documents and images, with Web Worker processing and support for many input sources. Accuracy drops on distorted pages, mixed content, and layouts with tight borders.
Configure how VCR matches requests to recorded cassettes
VCR request replay depends on matching new HTTP requests to recorded ones; :match_requests_on lets you customize matching by URI, path, or a custom lambda.
Git: See more context in a diff
git diff can show more surrounding lines for each change, making it easier to understand context in modified files.
Debugging flickering VCR tests
VCR tests can flicker when recorded requests change because of randomness, timestamps, or generated sequences, making cassette mismatches hard to diagnose.
Ubuntu MATE: Custom time format for clock panel widget
The MATE panel clock can use a custom strftime format instead of the default display, making compact date-and-time layouts possible.
Styling SVGs with CSS only works in certain conditions
SVGs can be styled with CSS only when embedded inline; using them as images or sprites blocks styling, and IE support is limited.
Creating icon fonts with Icomoon
Custom icon webfonts need correct grid sizing, spacing, baseline, and backup handling; multicolor icons, blocked webfonts, and inline rendering add practical constraints.
Beware of rails' reverse_order!
reverse_order breaks on complex SQL sorting and can generate invalid queries in Rails 4; Rails 5 raises ActiveRecord::IrreversibleOrderError instead.
Master the chrome history and autocomplete
Address-bar suggestions can outrank bookmarks and recent sites in Chrome; SHIFT + DEL removes unwanted entries, and a custom history search restores easier access to recent pages.
AngularJS Cheat Sheet (PDF)
Quick reference for commonly used AngularJS features, useful when you need syntax and concepts at a glance.
Running awstats on a single logfile
Generate a one-time AWStats report from a single web log file by using a minimal config and disabling DNS lookups for faster output.
Git error: "badTimezone: invalid author/committer line - bad time zone"
Malformed commit timestamps can make git clone fail with badTimezone when strict object validation is enabled. Disabling fetch.fsckobjects works around the error.
Pexels: Free stock photos
Free stock photos for personal and commercial use without attribution, with permission to modify images.
Detecting if a Ruby gem is loaded
Activated gems can be checked through Gem.loaded_specs, and required libraries can be detected with defined? on a constant they define.