Full Width [alt+shift+f] Shortcuts [alt+shift+k] Open Links Directly Enable Read Mode [alt+shift+r] Grayscale [alt+shift+g]
Sign Up [alt+shift+s]

alexwlchan

1

ThisWebHost is a hosting provider for Wordpress blogs & other internet stuff from the UK (since 2008). Try ThisWebHost.

advertise here
alexwlchan
Creating a Python dictionary with multiple, equivalent keys In my previous post, I was creating groups of students, and I wanted to track how many times...
3 months ago
17
3 months ago
In my previous post, I was creating groups of students, and I wanted to track how many times students had worked together. I created a nested dictionary to track the pairs: pairs = { 'Alice': {'Bryony': 3, 'Caroline': 1, 'Danielle': 0, …}, 'Bryony': {'Alice': 3, 'Caroline':...
alexwlchan
Snippets to manage albums in Photos.app Recently I’ve been building some tools to help me manage my photo collection, and part of that...
a week ago
9
a week ago
Recently I’ve been building some tools to help me manage my photo collection, and part of that involves moving photos in and out of albums. The tool I’ve built is very specific to my workflow and unlikely to be immediately useful to anyone else, but I thought some of the code for...
alexwlchan
Redecorating my bedroom Back in March, I was visiting my sister and her newly-redecorated home, and it gave me the...
3 weeks ago
7
3 weeks ago
Back in March, I was visiting my sister and her newly-redecorated home, and it gave me the inspiration to finally redecorate my bedroom – something I’ve been thinking about for two years. My bedroom used to have white walls, a dark grey feature wall, and a purple sliding...
alexwlchan
Using templates in Terraform to document a deployment I’ve been doing a bunch of new Terraform recently, and I’ve started using it to document the...
a month ago
7
a month ago
I’ve been doing a bunch of new Terraform recently, and I’ve started using it to document the deployments it’s creating. In particular, I’ve started using Terraform to create README files which describe the exact infrastructure it’s just created. Here’s my latest example: a README...
alexwlchan
Starting Docker just before I need it Although I use Docker a lot, I don’t leave it running all the time – it can be quite a resource hog,...
4 days ago
7
4 days ago
Although I use Docker a lot, I don’t leave it running all the time – it can be quite a resource hog, and even if it’s doing nothing it can make my laptop feel sluggish. I’ll often stop if it my computer feels slow, which is great right until the next time I need to use it: $...
alexwlchan
Getting alerts about flaky ECS tasks in Slack At work, we use Amazon ECS to run some of our Docker-based services. ECS is a container...
a month ago
6
a month ago
At work, we use Amazon ECS to run some of our Docker-based services. ECS is a container orchestrator, similar to Kubernetes: we tell it what Docker images we want to run in what configuration, and it stops or starts containers to match. If a container stops unexpectedly, ECS...
alexwlchan
Upward assignment in Ruby Ruby has had leftward assignment (x = 4) since its first public release, and a few years ago it...
4 months ago
6
4 months ago
Ruby has had leftward assignment (x = 4) since its first public release, and a few years ago it added rightward assignment (4 => x). Then at RubyConf 2021, Kevin Kuchta explained how to abuse Ruby features to build a downward assignment operator (yes, this really...
alexwlchan
My favourite books from 2022 I read 71 books this year, which is the most I’ve read in a single year since I started keeping...
5 months ago
6
5 months ago
I read 71 books this year, which is the most I’ve read in a single year since I started keeping detailed records. I don’t set reading goals, but I’m pleased with that. Nearly a third of those books came from my local library; both books I knew I already wanted to read, and books...
alexwlchan
The maths cross-stitch that hangs behind me I was chatting to a new colleague last week, and she asked about the picture that hangs behind me...
8 months ago
5
8 months ago
I was chatting to a new colleague last week, and she asked about the picture that hangs behind me when I’m on video calls – which made me realise I’ve never posted about it here. It’s a rather nice piece that I’m quite pleased with, and it’s worth sharing. Most of my...
alexwlchan
Agile and iterative project management Earlier today, I gave a talk for the the Open Life Science Program about agile and iterative project...
7 months ago
5
7 months ago
Earlier today, I gave a talk for the the Open Life Science Program about agile and iterative project management. I was talking about how READMEs serve as the first point of contact for a project; how they get new users interested in and excited about the project. The cohort calls...
alexwlchan
Testing JavaScript without a (third-party) framework Last week Julia Evans posted Writing Javascript without a build system, and it resonated with my own...
3 months ago
4
3 months ago
Last week Julia Evans posted Writing Javascript without a build system, and it resonated with my own experience. A lot of my websites (including this one) are content sites with just a bit of interactivity sprinkled on top, where I prefer writing vanilla JS over using complex...
alexwlchan
Redacting sensitive query parameters with koa and koa-logger At work, we use the Koa framework and koa-logger middleware as part of our website. Together, they...
6 months ago
4
6 months ago
At work, we use the Koa framework and koa-logger middleware as part of our website. Together, they give us nice request-response logs for all our traffic: <-- GET / --> GET / 200 754ms 57.28kb <-- GET /stories --> GET /stories 200 374ms 71.29kb <-- GET /works?query=trees -->...
alexwlchan
Generating art from lattice graphs A couple of weeks ago, I went to see my sister playing percussion in a brass band at the...
8 months ago
4
8 months ago
A couple of weeks ago, I went to see my sister playing percussion in a brass band at the Proms. While I was on the train home, I had an idea for a fun art project. I sketched it out on a napkin, got it working, posted a few pictures on Twitter, then put it down. On Saturday I was...
alexwlchan
A bookmarklet to show which responsive image was chosen I’ve had a lot of fun fiddling with the images on this blog recently, and I think they’re better...
4 months ago
4
4 months ago
I’ve had a lot of fun fiddling with the images on this blog recently, and I think they’re better than when I started. I’ve read a bunch of articles on responsive images, and I’ve sprinkled the <picture> and <source> tags everywhere to offer images in a variety of sizes and...
alexwlchan
Launching a rocket in the worst possible way Last month, NASA made headlines as they (finally) launched their SLS rocket as part of the Artemis 1...
5 months ago
4
5 months ago
Last month, NASA made headlines as they (finally) launched their SLS rocket as part of the Artemis 1 mission. The long and expensive development of SLS has been the subject of much debate, and caused a lot of online rage. I will now induce similar rage at a fraction of the...
alexwlchan
“Fixing” the rules of division Yesterday evening, Kate posted this tweet: Kate @thingskatedid i don't...
8 months ago
4
8 months ago
Yesterday evening, Kate posted this tweet: Kate @thingskatedid i don't *care* how maths works, half of zero should be 0.5 6:33 PM - 22 Sep 2022 This tweet promptly crawled inside my brain and sat there until I figured out how to make it work. I...
alexwlchan
A simple gallery plugin for Obsidian &rarr; I’ve been using Obsidian for my note-taking recently, and I really like it. It’s already absorbed...
7 months ago
3
7 months ago
I’ve been using Obsidian for my note-taking recently, and I really like it. It’s already absorbed all of my text notes, and I’m gradually using it for images too. To help me find my images, I’ve written a small Obsidian plugin. When I click the little picture icon in the sidebar,...
alexwlchan
Some small accessibility fixes I’ve been doing a bunch of testing with VoiceOver recently, helping to prepare the digital guides...
7 months ago
3
7 months ago
I’ve been doing a bunch of testing with VoiceOver recently, helping to prepare the digital guides for a new exhibition at work. I like to think my site is already pretty accessible – I put alt text on my images and I use semantic HTML – but I did find a few rough edges to...
alexwlchan
Publishing lots and lots of messages to SNS At work, we use Amazon SNS as the trigger for a lot of our data pipelines. You send a message to an...
a month ago
3
a month ago
At work, we use Amazon SNS as the trigger for a lot of our data pipelines. You send a message to an SNS topic, and it gets picked up by an SQS queue, an ECS task, or a Lambda function – and they in turn send new messages to other SNS topics, and the pipeline continues. Sending a...
alexwlchan
Filtering AWS CLI output by tags using jq Recently I was writing a shell script to deal with the AWS CLI, and I wanted to filter the list of...
a month ago
3
a month ago
Recently I was writing a shell script to deal with the AWS CLI, and I wanted to filter the list of results using jq. Specifically, I wanted to filter using some of the AWS tags, which are a bit unwieldy – although the tags form a set of key/value pairs, they’re returned as a list...
alexwlchan
Finding a tricky bug in Elasticsearch 8.4.2 A few weeks ago, I helped to find a bug in Elasticsearch 8.4.2. We’d started seeing issues in our...
8 months ago
3
8 months ago
A few weeks ago, I helped to find a bug in Elasticsearch 8.4.2. We’d started seeing issues in our Elastic cluster at work, and I was able to isolate the issue in a small, reproducible test case. I shared my code with Elastic engineers, and that helped them identify and fix the...
alexwlchan
My (tiny) contribution to Rust 1.64 A couple of months ago, I was writing some Rust, and the compiler spat out an error: error[E0412]:...
8 months ago
3
8 months ago
A couple of months ago, I was writing some Rust, and the compiler spat out an error: error[E0412]: cannot find type `Boolean` in this scope --> src/fs_helpers.rs:29:33 | 29 | pub fn is_ds_store(p: &Path) -> Boolean | ^^^^^^^ not found in...
alexwlchan
How we do bulk analysis of our Prismic content At work, we use Prismic as a headless CMS for our public website. If you see images or text that...
5 months ago
3
5 months ago
At work, we use Prismic as a headless CMS for our public website. If you see images or text that aren’t part of the catalogue, they’re probably managed through Prismic. To help us manage our growing Prismic library, we’ve built a number of tools and scripts to analyse our content...
alexwlchan
Ten years of blogging I bought the alexwlchan.net domain on November 8th, 2012, and the first web page would have appeared...
6 months ago
3
6 months ago
I bought the alexwlchan.net domain on November 8th, 2012, and the first web page would have appeared shortly after that (but the exact date is lost to history). This means I’ve been writing at alexwlchan.net for about a decade. The site looks very different now to how it...
alexwlchan
Finding books in nearby library branches I’m trying to make better use of my local public library. I want to read more books, and borrowing...
7 months ago
3
7 months ago
I’m trying to make better use of my local public library. I want to read more books, and borrowing from the library keeps the habit sustainable. It also saves a fair bit of money, and I don’t have to decide what to do with books when I’m done. Recently, I built a tool to help me...
alexwlchan
A Python function to iterate through an S3 Bucket Inventory For a couple of our S3 buckets at work, we use S3 Bucket Inventory to track their contents. Once a...
3 months ago
2
3 months ago
For a couple of our S3 buckets at work, we use S3 Bucket Inventory to track their contents. Once a week, it creates an inventory; a collection of compressed CSV files that describe every object in the bucket. If we want to analyse everything in the bucket, reading this inventory...
alexwlchan
Filtering out bogus requests from Netlify Analytics I host this site on Netlify, and I pay for Netlify Analytics to monitor its performance. It’s...
2 months ago
2
2 months ago
I host this site on Netlify, and I pay for Netlify Analytics to monitor its performance. It’s essentially server-side logging with a dashboard on top, and it’s more than sufficient for the very limited analytics I want to do here. One of the dashboard panels is “resources not...
alexwlchan
Going through my old school papers I left school in 2011, and I graduated from university in 2014. When I was done, I had six plastic...
3 months ago
2
3 months ago
I left school in 2011, and I graduated from university in 2014. When I was done, I had six plastic crates full of paper – exercise books, worksheets, school newsletters – everything I’d accumulated over nearly two decades of education. It was a lot. 🤯 I’m trying to reduce this...
alexwlchan
How moving to the cloud took our digital collections to new heights &rarr; I’ve written another article about digital preservation at Wellcome Collection, this time about the...
3 months ago
2
3 months ago
I’ve written another article about digital preservation at Wellcome Collection, this time about the benefits of moving our data storage and processing to the cloud. Building out this infrastructure is a large part of what I’ve been working on for the last six (!) years. It’s been...
alexwlchan
Beware of transparent backgrounds when using AVIF with ImageMagick 6 One of the things I did over my Christmas break was redo all the image handling on this site. Mostly...
4 months ago
2
4 months ago
One of the things I did over my Christmas break was redo all the image handling on this site. Mostly I’m catching up on the current “best practices” for images on the web. I’ve written a Jekyll plugin which allows me to use an image in a post like so: {% picture ...
alexwlchan
Getting the base directory of an sbt project This is a command you can run in a shell script to print the base directory of an sbt project: $...
6 months ago
2
6 months ago
This is a command you can run in a shell script to print the base directory of an sbt project: $ sbt --batch -error "project $PROJECT" "print baseDirectory" | tr -d "\n" For example: $ sbt --batch -error "project ingests_api" "print baseDirectory" | tr -d...
alexwlchan
Some experiments with circle-based art The header of this site is made of tiling squares in slightly varying shades of red. It’s meant to...
8 months ago
2
8 months ago
The header of this site is made of tiling squares in slightly varying shades of red. It’s meant to be subtle, but I think it still gives the site a unique look: I think of this as the “new” header, even though my screenshot library tells me I added it in 2016 (!), as does the...
alexwlchan
Changing the macOS accent colour without System Preferences In System Preferences, you can change the accent colour of your Mac: This affects...
6 months ago
2
6 months ago
In System Preferences, you can change the accent colour of your Mac: This affects colours throughout your Mac’s user interface, including buttons, menus, and tickboxes. When you pick a new colour, it updates everywhere, immediately. I want to write some automations...
alexwlchan
Splitting a class into balanced groups Earlier this week, my mum sent me an interesting problem. She’s got a class of 12 students, who are...
3 months ago
2
3 months ago
Earlier this week, my mum sent me an interesting problem. She’s got a class of 12 students, who are going to meet over 7 sessions. In each session, they’re going to split into 3 or 4 groups, and she wants to find an even distribution of groups – each person gets to work with...
alexwlchan
A day out at the Bure Valley Railway Last October, I had a day trip to the Bure Valley Railway, a narrow-gauge heritage railway in north...
6 months ago
1
6 months ago
Last October, I had a day trip to the Bure Valley Railway, a narrow-gauge heritage railway in north Norfolk. I came across it quite by chance – I was driving through Aylsham to get to a B&B, and I spotted a sign pointing to the railway. I checked the website for a timetable,...
alexwlchan
CSS formatting in the console I was poking around in Google Lens recently (which is Google’s magical reverse image lookup service)...
3 months ago
1
3 months ago
I was poking around in Google Lens recently (which is Google’s magical reverse image lookup service) and I was mildly surprised by what I saw in the developer tools console: Code that runs in the dev console can be very powerful, so I can understand why they want to...
alexwlchan
Saving your alt text from Twitter It seems like Twitter might be circling a drain, and so a lot of people are downloading a copy of...
6 months ago
1
6 months ago
It seems like Twitter might be circling a drain, and so a lot of people are downloading a copy of their archive in case the site goes down unexpectedly. But large as it is, the archive doesn’t contain everything: Kate @thingskatedid my twitter archive...
alexwlchan
Getting an Important Internet Checkmark to follow your cursor Are you an Important Brand? Do you have an Internet Presence? Do you worry about being Impersonated...
5 months ago
1
5 months ago
Are you an Important Brand? Do you have an Internet Presence? Do you worry about being Impersonated Or Parodied Online? Then I may have something for you. On your social media, you can bask in the warmth of an Important Internet Checkmark which tells your users that they’re...
alexwlchan
A script to get Live Text from images One of my favourite new features on Apple’s OSes in the last few years is Live Text, which is an...
5 months ago
0
5 months ago
One of my favourite new features on Apple’s OSes in the last few years is Live Text, which is an optical character recognition tool that lets you select text in images. This sort of tech has been around for decades, but having it built into the OS makes it much easier to use. The...
alexwlchan
Cats, cross-stitch, and copyright I’ve always been a cat person, and my favourite species of cat (aside from the cats I’ve actually...
2 months ago
0
2 months ago
I’ve always been a cat person, and my favourite species of cat (aside from the cats I’ve actually lived with) is the cheetah. This probably goes back to a school project about cheetahs I did when I was nine years old – I had to write about an endangered species for science...
alexwlchan
Changing the bulb in a Meridian Lighting CIR100B ceiling light I moved into my house a couple of years ago, and for all that time I’ve had a porch light which...
4 months ago
-1
4 months ago
I moved into my house a couple of years ago, and for all that time I’ve had a porch light which doesn’t work. I’ve tried taking it apart a couple of times to replace the bulb, but to no avail. Although it’s a simple cylinder with only a black base and a clear cover, I couldn’t...