November 28, 2022
TL;DR: An idea for a small library that makes it easier to abort Promise chains. But... why? I've found myself wanting to be able to easily abort a Promise chain many times. And by that I don't mean just the initial promise itself (which is possible), I...
October 7, 2022
TL;DR: Use template (not div) and textContent (not innerText). Every so often I run into a situation where I need to strip HTML from a string. For example. this blog's post list includes a short excerpt of the actual post, but I didn't want any of the cont...
August 21, 2022
TL;DR: Users are being spied on, websites are broken and hijacked. Most people probably don't know this, but when you click a link in Facebook, Instagram, TikTok and many other apps, you're viewing the site (and all subsequent pages you visit from there)...
July 6, 2022
TL;DR: If you need a double rAF() for a transition to work, getComputedStyle().opacity may be a cheap, synchronous alternative. I thought I'd share a neat little trick I learned a few years back, just a nice and short blog post like I did a while ago. ...
June 25, 2022
TL;DR: No one is talking about Apple announcing it's finally going to bring Web Push to Safari. Safari is getting Web Push! On iOS! If you ask me, the biggest thing to come out of WWDC 2022 was the announcement of Web Push for Safari. MacOS is going to ...
May 16, 2022
TL;DR: Returning a promise in new Promise() never resolves, but returning a promise in .then() does. Consider the example below: The constructor of Promise expects a function that only resolves when its resolve() callback is called. Having it both (callba...