duncanlock.net

Sometimes I want to have a just a little bit of CSS that’s unique, just for one particular page or post. I don’t want a whole stylesheet, or add this to my site-wide theme, just for one post - I wanted a way to add it in the post itself.

This is how I did it:

Read More

You can use the new CSS :is selector to write complex CSS selectors in a much more compact way

They will dig up your garden to get them.

How to allow python (or anything else) to listen/bind to port 80 without being root

Ninja is a surprisingly nice build system for tiny projects. That's more or less the opposite of what it's designed for, but it works really well for tiny things.

The content-type guessing done by AWS CLI is based on the mimetype definitions available on your system. You can improve the mimetype guessing by updating these definitions.

I had an issue where the AWS CLI wasn't guessing the content-type of SVG files correctly on sync and was setting them to `application/octet-stream` - the default "I don't know" mimetype. This is a quick fix for that.

Three mason jars, full of fermenting things. Two Bánh Mì(ish) and one eggs.
Figure 1. Three mason jars, full of fermenting vegetables. Two Bánh Mì(ish) and one eggs.

I’ve been fermenting vegetables of various kinds (and occasionally other things) at home for a little over two years. It’s a fun, interesting & nutritious hobby. On the whole it’s pretty easy and low stakes – the worst thing that happens is a few cucumbers go mouldy.

Because it doesn’t involve any heat – but does include pouring, measuring, stirring, spiralizing, grating (and some chopping) – it’s ideal to do with little kids.

According to my notes (which I didn’t start initially), I’ve made ~56 batches of ferments, ranging in size from a single 1l mason jar, to three 2l ones.

These are my lessons so far:

The difference between science & screwing around, is writing it down

As they say, the …

Read More

How to slugify strings in bash, using a fairly simple function.

Sometimes I want to resolve several promises at once, then do something when they're all done. For example, make several API calls, then do something with all the results. Promise.allSettled is a better way to do this.