Debounce and Throttle in JavaScript, With Real Examples
Debounce waits for the pause. Throttle enforces a rhythm. Which to use for search boxes, scroll handlers, resize, autosave and button clicks — with implementations you can paste.
Read articlePHP, JavaScript, Laravel, databases and front-end — practical guides from the Happy Coders engineering team.
Debounce waits for the pause. Throttle enforces a rhythm. Which to use for search boxes, scroll handlers, resize, autosave and button clicks — with implementations you can paste.
Read articleDark mode has three states, not two. How to respect the system setting, let the user override it, remember the choice, and avoid the white flash on load — with CSS variables and about twenty lines of JavaScript.
Read articleA modal that traps focus, closes on Escape, restores scroll and works with a screen reader — in about sixty lines of plain JavaScript, plus the native dialog element that replaces most of it.
Read articleA straight comparison of REST and GraphQL: the problems GraphQL solves, the ones it creates, when REST is still the right answer, and how to decide without rewriting anything.
Read articleEvery check people put on a PHP file upload, ranked by whether it actually stops anything. The extension check that does nothing, the MIME check that lies, and the three things that genuinely work.
Read articleCross-site scripting explained with real PHP: the three kinds, why escaping on input is the wrong place, the one function that fixes most of it, and the attacks that get past a careless fix.
Read article