Smidgeons

Inspired by Maggie Appleton's smidgeons

the web locks API is implemented a bit differently in different browsers

In particular, I built myself a little bug, by assuming that navigation would release the lock. It doesn't, and in fact, navigating while the lock is held can cause the lock to be held for a very long time on WebKit.

Consider the following:

await navigator.locks.request('my-lock', async () => {
  await someAsyncOperation();
});
window.location.href('/');

Safe? No! Because although the lock may be technically released in JavaScript, neither the lock release nor the navigation are fully synchronous, as they use IPC. This can cause WebKit in some places to put the page into the BFCache before the lock is released, creating a 'zombie lock', where the lock doesn't get released because the page is suspended.

In order to avoid this, you need to wait for the next macrotask before navigating, as the browser will use the task boundary to run clean up and handle its own queue (including the 'release' IPC message).

await new Promise(resolve => setTimeout(resolve, 0));
Mon, 15 Dec 2025

A hyperplane divides a space of arbitrary dimensionality

This boggled my brain a bit at first, but it's less complicated than it sounds. If you have a one-dimensional space (i.e. a line), you can draw a dot at any point on the line to divide it. If you have a two-dimensional space (i.e. a surface), you can draw a line across the surface to divide it. If you have a three-dimensional space, you can put a plane through it to divide it.

If you're doing something like facial recognition with embeddings in a 128-dimensional space, you can put a hyperplane through that space to divide it.

This is useful for LSH (or 'fuzzy matching' in hyperdimensional space).

Sat, 13 Dec 2025

Supafly, Carter Walsh & Greg Stainer - I Just Can't Stop

Fri, 3 Oct 2025

What a bop

Fri, 19 Sept 2025

Camels actually kind of do store water in their humps

As Hank Green explains, camels store fat which they can then metabolise with oxygen to create water. And it turns out you get more water that way.

Tue, 2 Sept 2025

Sidewalks are a promise. A promise of connection. If there’s a sidewalk, there’s gonna be things that sidewalk connects to, be it a dog park, or a café, or a record store, or a barbershop.

I love Mike Monteiro's writing and his thoughts on life. This is a brilliant newsletter piece.

https://buttondown.com/monteiro/archive/how-to-leave-the-house/

Fri, 27 Jun 2025

2025/05/28 and 2025-05-28 are parsed differently by Date

This is because “2025/05/28” is considered to be a local date (and so is parsed with the users current timezone factored), while “2025-05-28” matches the ISO8601 format, and so is parsed as UTC.

Wed, 28 May 2025

New Jorja Smith is banging UK garage/bassline

Fri, 16 May 2025

Kiwis lay unbelievably big eggs

X-ray of a kiwi about to lay her egg
Sat, 3 May 2025

Flying saucers might have been a US government conspiracy to decrypt Soviet communications

Apparently, it’s called “gardening”. The idea is if you can plant known phrases (like “flying saucer”) which are going to be encrypted, you can do some more sophisticated attacks against encryption.

Tue, 8 Apr 2025

New Coheed and Cambria album released today 💿

Fri, 14 Mar 2025

If you put huge amounts of energy into small amounts of space, mass can condense out of nothing

10^26^ W/cm^2^ https://www.youtube.com/watch?v=jgafb8G7i4o

This sounds like an interesting idea to include in a sci-fi novel.

Tue, 25 Feb 2025

Bees are more closely related to their siblings than their offspring

Male bees are all essentially clones of their mothers, and female bees inherit 100% of their father’s genetic material and 50% of their mother’s, meaning that male bees are genetically identical to their brothers, and female bees are 75% related to their sisters while they are 50% related to their offspring (the other 50% coming from the father). https://www.subanima.org/bees/

Sat, 18 Jan 2025

Having friends makes you less sick

Social support and social networks have also been linked both to the incidence of cardiovascular disease and to recovery from heart attacks. In a striking experiment, researchers have also shown that people with friends are less likely to catch a cold when given the same measured exposure to the cold virus - in fact the more friends they had, the more resistant they were. Experiments have also shown that physical wounds heal faster if people have good relationships with their intimate partners.
- The Spirit Level: Why Equality is Better for Everyone - Richard Wilkinson and Kate Pickett

Tue, 7 Jan 2025

Only when the tide goes out do you discover who's been swimming naked.

Great quote from Warren Buffett. I think he probably meant this to apply to naïve investors but I like it because it applies everywhere. It’s easy to be successful when everyone else is successful too, but it’s much harder to be successful when circumstances are not conducive to success.

Tue, 26 Nov 2024