Field notes, snippets and tools I reach for every week. Curated for engineers who care about both performance and craft.
A practical guide to GSAP ScrollTrigger choreography.
export function useDebounced<T>(v: T, ms = 200) {
const [d, setD] = useState(v);
useEffect(() => {
const id = setTimeout(() => setD(v), ms);
return () => clearTimeout(id);
}, [v, ms]);
return d;
}export const timing = (req, res, next) => {
const t = process.hrtime.bigint();
res.on("finish", () => {
const ms = Number(process.hrtime.bigint() - t) / 1e6;
res.setHeader("Server-Timing", `app;dur=${ms.toFixed(1)}`);
});
next();
};