Using EC2 health checks to take down your own site

A loader balancer sits in front of a pool of servers, often web servers. It receives requests and routes those requests to one of the available servers so as to distribute the load among them. To ensure that the load balancer is only routing requests to healthy servers it can utilize something called a health …

Performant Lazy Loading In React

One day Intersection Observer will become widely supported enough that you can use it to implement lazy loading. For the moment however its browser support is too patchy, the polyfill explodes if it comes within 30 feet of a server-side render, and it all feels too new to bet the farm on. One day…. One …

Delete All My Docker Containers

Sometimes you need a clean slate and want to completely blow away your Dockerized dev dependencies. I recently had a little trouble genuinely clearing Docker containers containing a database and a message queue which I wanted completely fresh and empty. The following commands did the trick. docker-compose down -v docker system prune docker-compose up docker …

Determining image size in Typescript

Accurately determining the size of an image file sounds simple but the devil is in the details. This is especially true if there are lots of images, the files are stored in S3 or anywhere else that isn’t your local machine, if you have corrupt images mixed in there or any other complexities that come …

WordPress plugin won’t deactivate

You go to the plugins page of your WordPress site, click deactivate, the page reloads but the plugin is still active. How does that even happen? We have encountered this situation twice over the years. In both cases the cause appeared to be some other rogue plugin. Disabling the problem plugin caused the operation of …

What to do when you edit a C# table adapter and get hundreds of duplicate attribute errors

Today I ran into a rather bizarre problem that appears to be a bug in Visual Studio itself. It is always fun when the auto-magical functionality of Visual Studio breaks down. After editing a table adapter in a dataset I hit compile and was greeted with several hundred compilation errors all suggesting that I was …

Chinese Character Challenge – Update 1

After posting my Chinese character revision game on reddit I received some excellent feedback. In the week since then I have been hard at work producing an updated version. Here is a link to the game for those that want to cut to the chase. Note that I have further updated the game since writing …

Chinese Character Challenge – A Slightly Less Dull Way to Revise

Recently I was in at Moodle HQ and another programmer there was demonstrating a space game he made that extracted questions from a Moodle quiz. I believe this is it https://github.com/xow/moodle-mod_quizgame. I began to think about various other kinds of games that could easily draw questions from a quiz. As I am making an attempt …

An Attempt At Postgres Support In Moodle Elis 2.6

ELIS doesn’t currently support Postgres, which is kind of annoying. As well as annoying its a little concerning. So I decided to use a little of my spare time to see what is going on. A big part of the reason why applications often run into problems with Postgres is because its so much more …