Git restore vs. reset for reverting previous revisions

git restore and git reset both revert changes, but one targets files while the other moves HEAD and rewrites commit history.

redirect_to and redirect

Rails URL redirects differ in status code, query-parameter handling, and security implications; choosing 301 or 302 affects browser behavior and search engine indexing.

Do not pass params directly into url_for or URL helpers

Passing untrusted parameters into url_for or _url helpers can create open redirect vulnerabilities and send users to attacker-controlled hosts.

Do not use "permit!" for params

params.permit! marks all request parameters as safe and mutates the original object, risking mass assignment vulnerabilities later in Rails code.

Running external commands with Open3

Reliable process execution in Ruby needs clean output capture, status checks, and safe handling of stdin, environment variables, and long-running commands.

Git: How to rebase your feature branch from one branch to another

Move a feature branch from one base branch to another with git rebase --onto, preserving only the branch’s own commits and avoiding unrelated history.

Touch devices don't have mouseover events

Touch devices do not support hover or mouseover states, so tooltips and controls hidden behind hover can disappear for iPads and smartphones.

Chromedriver issue #4550 breaks the user agent for device emulation via device name

Chromedriver 116 breaks mobile emulation user-agent spoofing for deviceName; navigator.userAgent falls back to HeadlessChrome unless device metrics and userAgent are set manually.

Capybara: How to find the focused element

Focused-element lookup in Capybara can be filtered directly with focused: true; the old :focus pseudo-class no longer works in newer versions.

Web Components Accessibility FAQ

Web components often raise accessibility questions, especially around semantics, keyboard support, and assistive technology behavior.

Postgres in Alpine docker container: sorting order might differ

String sort order can change when PostgreSQL runs in an Alpine-based Docker image because locale and collation defaults differ from Debian images.

Minifying object properties in JavaScript files

JavaScript minifiers can shorten private members safely when internal names follow _ or # conventions, reducing bundle size without mangling public APIs.

Debugging SPF records

SPF records can be hard to validate, especially when syntax errors or DNS lookup limits break mail delivery. Online checkers help test coverage and new policies before deployment.

HTTP 302 redirects for PATCH or DELETE will not redirect with GET

Browsers may keep PATCH and DELETE on 302 redirects instead of switching to GET, breaking AJAX flows. Use 303 See Other or POST method override to force a GET follow-up.

What's so hard about PDF text extraction? ​

PDF text extraction is harder than it looks because the format allows extreme flexibility, so automatic text data retrieval often fails in edge cases.

Node: How to run a globally installed package with npx

Globally installed npm packages are not directly runnable with npx --no-install; npx -- works when given the global package path.

RSpec: How to write isolated specs with cookies

Cookie-dependent behavior in Rails specs is hard to test outside controller specs, especially signed and encrypted values. ActionDispatch::Cookies::CookieJar provides isolated access in request and helper specs.

Rails: Kill spring with fire

Rails Spring processes can linger and restart unexpectedly, interfering with command runs; stopping the process and disabling auto-start prevents it from coming back.

Devise: Invalidating all sessions for a user

Stolen Rails session cookies can remain usable after logout with Devise. Invalidating them requires changing the authentication salt, resetting the password, or storing sessions server-side.

NVM: How to automatically switch version when changing directories

Node.js version switching in Bash is manual by default, so projects with .nvmrc can run the wrong runtime until nvm use is triggered automatically.

Scrum: Online Planning Poker

Scrum teams need a simple way to agree on story estimates without registration or setup. PoinZ provides online planning poker for collaborative estimation.

How to transition the height of elements with unknown/auto height

Collapsing dynamic content cannot animate height: 0 to height: auto; a grid row transition between 0fr and 1fr provides a modern CSS workaround.

How to prevent a 1fr grid column overflow

Long content in a 1fr grid track can force overflow and hide neighboring columns. minmax(0, 1fr) lets the track shrink instead of keeping its automatic minimum size.

Use -webkit-line-clamp to natively truncate long (multi-line) texts with an ellipsis

Native CSS truncation for multi-line text adds an ellipsis after a fixed number of lines, avoiding JavaScript clamping and its performance cost.