A community-curated list of flexbox issues and cross-browser workarounds for them

Flexbox can behave differently across browsers, and layout bugs often need known workarounds. A community list collects reported issues and fixes for broken responsive layouts.

How to fix "Exit with code 1 due to network error: ProtocolUnknownError" with wkhtmltopdf

wkhtmltopdf can fail with ProtocolUnknownError when file:// URLs are blocked by default, preventing local assets such as stylesheets from loading.

SEO: The subtle differences of robots.txt disallow vs meta robots no-index

robots.txt can block crawling without removing URLs from search results, while noindex removes accessible pages from indexing. Disallowed URLs may still appear as search matches.

Do not use "flex: 1" or "flex-basis: 0" inside "flex-direction: column" when you need to support IE11

IE11 miscomputes flex: 1 in column flex containers because it implies flex-basis: 0, causing overlapping children; flex: 1 1 auto works reliably.

Prefer using Dir.mktmpdir when dealing with temporary directories in Ruby

Unique scratch directories prevent flaky tests and stale files in parallel Ruby test runs. Dir.mktmpdir creates them safely and can use a custom base path.

How to get the git history of a file that does not exist anymore

Recover the change history of a deleted file in Git by using git log with history-preserving flags across all references.

Rails: Comparison of Dates - before? and after?

Rails 6+ adds before? and after? for comparing dates and times; between? checks whether a value falls within a range.

Ruby and Rails: Debugging a Memory Leak

Growing memory usage in Ruby and Rails can exhaust a process and cause crashes; ObjectSpace.count_objects helps identify leaking object types, and derailed_benchmarks can aid diagnosis.

Rails: Custom validator for "only one of these" (XOR) presence validation

Rails models often need exactly one of several attributes filled in; built-in validations do not handle this XOR case cleanly. A custom ActiveModel::Validator can enforce blank-or-singleton presence with clear errors.

Converting SVG to other vector formats without Inkscape

Convert SVG files to PS, PDF, or EPS without Inkscape using CairoSVG and ps2eps; it is lightweight, fast, and works from files or stdin.

A simpler default controller implementation

Rails controllers can stay short, testable and authorization-friendly by using a minimal shared blueprint for CRUD, strong params, scopes and optional HTTP caching.

Updated: Git: removing feature branch on merge

@{-1} resolves to the previous branch name, including when git merge - uses the last checked-out branch.

Creating a Rails application in a single file

Running Rails in one file is useful for quick experiments, debugging bugs, or embedding an app in tests, but version and dependency drift can cause surprises.

Web development: Accepting a self-signed certificate in Google Chrome

Chrome can reject locally generated self-signed certificates and hide HTTPS even when they work. Importing the certificate or launching with --ignore-certificate-errors allows testing.

Working with or without time zones in Rails applications

Rails time handling is error-prone because Time.now and Time.current can differ. A single-time-zone setup needs matching Active Record and time zone configuration.

Latency and bandwidth illustrated

Latency and bandwidth are often confused but affect network performance in different ways: one is delay, the other is data rate.

Local development with SSL and Puma

Local HTTPS for Puma development needs a trusted certificate and SSL binding so Rails runs on https://localhost:3000 without browser warnings.

Yarn: Use yarn-deduplicate to cleanup your yarn.lock

Duplicate package versions in yarn.lock can bloat bundles and keep unnecessary installs. yarn-deduplicate merges compatible entries in Yarn v1; Yarn v2+ deduplicates natively.

CSS: :is() pseudo selector

:is() groups selector lists and uses the highest specificity of its arguments, simplifying CSS while avoiding repeated compound selectors.

CSS: :where() pseudo selector

:where() matches selector lists with zero specificity, simplifying repeated CSS selectors without affecting override behavior; invalid items in the list are ignored.

Rails: How to check if a certain validation failed

Find out whether a Rails validation failed by checking ActiveModel::Errors types instead of messages, which is useful in tests and for validations with extra options.

Generating and streaming ZIP archives on the fly

Large ZIP downloads can start immediately without writing files to disk, using zip_tricks_stream for custom content or zipline for existing attachments.

Cucumber pitfall: "Around" does not apply to your "Background" steps

Around hooks run only after Background steps, so setup or teardown placed there cannot affect background actions. Use Before and After hooks instead.

Valuable Chrome DevTools Shortcuts

Chrome DevTools shortcuts speed up debugging by toggling the console drawer, adjusting style values faster, and manipulating elements without the mouse.