-
New Jul 7, 2025
A job queue in two lines of JS
If you need a job queue in JS, you can do it in two lines: type Job = () => Promise<unknown>; let chain = Promise.resolve(); const enqueue = (job: Job) => chain = chain.then(job, job); For examp...
-
New Jun 29, 2025
Sticky snap: a better snapping algorithm
The “snapping” feature in most drawing apps has a problem: you can’t place the object near snap lines, so for precise positioning, you have to disable snapping. In this post, I show sticky snap,...