How to use git fixup

git commit --fixup creates a follow-up commit that git rebase --autosquash can fold into an earlier change, keeping feature-branch history tidy.

Installing multiple MySQL versions on the same Linux with mysql-sandbox

Run several MySQL releases side by side in one Linux account for testing or Rails development, using isolated sandboxes on separate ports.

Rails: When defining scopes with class methods, don't use `self`

Scopes defined as class methods can drop earlier filters when they return self; use all to preserve chained conditions in Rails 2 and 5.

Rubygems: Installing the last version of rubygems that has no rubyforge_project deprecation warning

Rubygems 3.1+ adds a Gem::Specification#rubyforge_project deprecation warning that can clutter development logs; installing 3.0.8 avoids it on older projects.

Git: How to add changes matching a regular expression

Stage only matching lines from a large git diff and commit them separately by filtering hunks with grepdiff before git apply --cached.

Five years of "Today I Learned" from Josh Branchaud

A curated set of 900+ personal programming tips spans Ruby, Rails, Git, Unix, Chrome, and JavaScript, with many small shortcuts for daily development work.

Rails: Concurrent requests in development and tests

Puma concurrency in Rails depends on workers and threads; self-calls during a request can deadlock in development or tests unless multiple workers are enabled.

How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber

Code coverage reveals untested Rails paths and blind spots across RSpec, Cucumber, and parallel test runs. SimpleCov can separate reports and add branch coverage.

Using #deep_dup for copying whole hashes and array

#dup and #clone only copy the top level of nested hashes and arrays; #deep_dup duplicates the full structure, but cycles can trigger SystemStackError.

How to: Throttle CPU in Google Chrome

Limit Chrome CPU speed to measure frontend performance and reproduce sluggish behavior in DevTools.

Video transcoding: Web and native playback overview (April 2020)

Browser video playback depends on container and codec support; MP4 with H.264 and AAC works broadly, while WebM can serve modern clients and downloads need native playback support.

Devise: How to allow only HTTP Basic Auth and disable the HTML sign-in form

Force Devise to use browser Basic Auth instead of the HTML sign-in form by enabling http_authenticatable and removing navigational formats.

How to write good code comments

Comments work best when they explain why code exists, not what it does, and stay close to the relevant code, robust against change.

Heads up: Ruby's Net::HTTP silently retries a failing request

Net::HTTP may retry an idempotent request once after failure, so a timed-out call can take up to twice the configured timeout.

Best Practice: Creating User Accounts Without Sending the Password

Admin-created accounts need secure initial access and immediate password replacement. A temporary secret password plus a forced reset avoids sending credentials directly.

How to avoid ActiveRecord::EnvironmentMismatchError on "rails db:drop"

Rails database tasks can fail with ActiveRecord::EnvironmentMismatchError after restoring a dump from another environment. Updating ar_internal_metadata or disabling the environment check lets rails db:drop proceed.

Event order when clicking on touch devices

Touch interactions on mobile fire mouse events after touchstart and touchend, which can create duplicate handling unless the sequence is canceled.

Bash: How to use colors in your tail output

Coloring tail output makes log levels easier to scan, and ANSI escape codes in sed can highlight INFO and FATAL lines in different colors.

Capybara: How to find a hidden field by its label

Hidden form inputs are ignored by default in Capybara, causing find_field to fail unless type: :hidden is specified. This helps when tests must wait for JavaScript widgets to populate a field value.

Quick HTML testing with RubyMine

Quickly preview embed code or other HTML in RubyMine without creating a project file by using an HTML scratch file and opening it in a browser.

Letting a DOM element fade into transparency

CSS mask-image creates a fade-out effect by using an alpha mask, letting elements gradually become transparent with gradients or images.

Traversing the DOM tree with jQuery

jQuery traversal methods move a selection through the DOM tree to find descendants, ancestors, parents, children, or matching elements efficiently.

Ruby: How to fetch a remote host's TLS certificate

Fetch a remote server’s TLS certificate in Ruby without sending a full request. The certificate can be inspected, cached as PEM, and reloaded with OpenSSL::X509::Certificate.