Browsing: Development

A step-by-step guide to fixing the WordPress error Error establishing a database connection: what it means, checking wp-config.php with WP-CLI, testing credentials with the mysql client and reading its error codes, restarting a stopped MariaDB or MySQL, out-of-memory kills, full disks, user privileges, localhost vs 127.0.0.1, too many connections, repairing tables, migrations and hacked sites, and preventing it with monitoring, swap and backups.

A practical guide to undoing the last commit in Git: a decision table, git reset –soft, –mixed and –hard with what each keeps, amending messages and forgotten files, git revert for pushed and merge commits, force-with-lease, moving a commit to a new branch, removing a file from the last commit, undoing several commits, Windows quoting, and recovering anything with git reflog.

A practical guide to fixing CORS errors in the browser: what an origin is, why No Access-Control-Allow-Origin header is present appears, simple and preflight requests, debugging in DevTools and with curl, server fixes in Express, FastAPI and nginx, credentials and cookies, the Vite dev proxy, hidden causes such as 404, 500 and redirects, and why no-cors and wildcards are not fixes.

A practical guide to fixing the SSH error Permission denied (publickey): reading ssh -v output, wrong user or key, too many keys in the agent, authorized_keys content and permissions, StrictModes, sshd_config settings, server-side logs, new VPS default users, GitHub and GitLab, old RSA keys after OpenSSH 8.8, Windows key permissions and safe recovery through a provider console.

A step-by-step guide to fixing nginx 502 Bad Gateway errors: what 502 means, how to read the nginx error log, the exact log messages for each cause, PHP-FPM socket paths after PHP upgrades, socket permissions, stopped or crashed upstream apps, localhost and IPv6 surprises, Docker Compose networking, too big headers, pm.max_children exhaustion, Cloudflare 502s and how to prevent the next one.

A practical jq tutorial built on one sample file you can copy: paths and raw output, select and boolean filters, map, reduce, group_by, sort_by and unique for reports, CSV and TSV export, defaults with //, updating and deleting fields, safe shell variables with –arg and –argjson, exit codes with -e for scripts, error handling with ? and try, JSON Lines logs with slurp and inputs, and real API responses with curl.

A practical guide to debounce vs throttle in JavaScript: what each one does to a burst of events, a decision table by use case, dependency-free implementations with leading mode, cancel and flush, a leading-and-trailing throttle, one-call-per-frame throttling with requestAnimationFrame, a search box that debounces input and aborts stale requests, passive scroll listeners, unit tests with Node.js mock timers and the bugs that show up in production.