Everything you ever wanted to know about constant lookup in Ruby

Constant resolution in Ruby can be surprising when names are missing or resolved in an unexpected scope. Understanding lookup rules helps diagnose NameError and visibility issues.

What Sass means by "@function rules may not contain style rules."

Sass functions must return values; a computed line left unassigned or unreturned triggers @function rules may not contain style rules because Sass does not mutate objects.

Chrome DevTools: Event Listener Breakpoints

Chrome DevTools can pause code when browser events fire, making it easier to trace where clicks and other handlers are processed.

Chrome DevTools: DOM Breakpoints - Breakpoints on HTML Elements

DOM breakpoints in Chrome DevTools or Firefox Inspector help trace JavaScript that changes an element’s subtree, attributes, or removes it.

Stop writing "require 'spec_helper'" in every spec

Configure .rspec to load spec_helper or rails_helper automatically, avoiding repeated require lines in every spec and making parallel test setups work with .rspec_parallel.

Capybara: evaluate_script might freeze your browser

evaluate_script can freeze a browser window for about 10 seconds when it returns complex JavaScript objects; execute_script avoids the costly result conversion.

GitLab: Git alias for creating a merge request on push

A Git alias can push a branch to GitLab and create a draft merge request automatically, with an optional target branch override.

Chrome DevTools: Quick Bite - Store Element in Global Variable

Chrome DevTools can store a selected DOM element as a global variable for quick inspection and reuse in the console.

ActiveType::Object: Be careful when overriding the initialize method

Overriding initialize in ActiveType::Object can break ActiveRecord-style setup, freeze instances, or cause argument errors unless super is called with one attribute hash.

Temporary solution for connection errors with rubygems

Bundler can fail to fetch gems from rubygems.org when IPv6 connectivity is broken. Lowering IPv6 priority in /etc/gai.conf can let bundle install succeed temporarily.

Debug flaky tests with an Unpoly observeDelay

Flaky integration tests can outrun watchInputDelay, causing Unpoly field updates to overwrite typed input before requests start. Lowering the delay or signaling CapybaraLockstep reduces failures.

Rails: Validations of Dates, Numerics and Strings with ComparisonValidator

Rails 7+ validates dates, numbers and strings with ComparisonValidator for greater-than and less-than checks, replacing custom comparison code.

How to emulate simple classes with plain JavaScript

Class-like objects with private state and public methods in plain JavaScript can run in any browser without this, prototypes, CoffeeScript, or Babel.

Whitelist Carrierwave attributes correctly

Strong Parameters for CarrierWave uploads need more than the file field; cache and removal flags keep images across validation errors and enable deletion.

Git: Switch

Safer branch navigation in Git benefits from git switch, a clearer alternative to git checkout for changing, creating, and detaching branches.

Exploring the disk usage with ncdu

Finds large files and directories consuming disk space on servers or minimal systems with a text-based interface.

You can implement basic object-fit behavior with background images

Need object-fit behavior with Internet Explorer support: background-size: contain or cover can mimic image fitting and cropping in IE9+.

In MySQL, a zero number equals any string

MySQL treats 0 = 'any string' as true, so mixed string-integer comparisons can match unexpected rows and bypass indexes; PostgreSQL rejects such comparisons.

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.