The 100 Prisoners Riddle I found it hard to believe Veritasium's claims about the 100 Prisoners Riddle, so I wrote a small experiment to confirm that the proposed solution did in fact improve the odds so drastically.
What3Words: DNS Edition There's only about 4.2 billion IPv4 addresses. This seems like a lot, but if you've got a list of 2048 words, you'd only need three of them to cover all the IPv4
Sometimes, Bash Scripts are Best! I've been looking at the performance of my website and decided to cache some of my assets, like fonts and CSS files. To have them cached for as long as possible, and prevent
Dice Roller I wanted to make a specific bit of UI to help me roll some dice, and it turned out quite interesting. I need to roll some standard D&D dice, and make it as quick as possible — keyboard shortcuts preferred over mouse clicks.
Date Pickers are badly broken. Here's why. TLDR: “Dates are broken; use Luxon and subsequently Temporal; test timezones in your unit tests if you can!”. Part 1 — Picking A PickerLong ago, we’d started off by ruling out any date
Using Simple Game AI to Create a Killer Mancala Bot Since graduating last year, my CS has got a bit rusty – working full-time, there's not much time to learn much dense theory. But there's always time to play a quick board game. Mancala
Testing Svelte with Knobs and Dials I'm super excited about Svelte! Compiling JS instead of doing virtual-DOM diffing is loads faster and opens up some amazing possibilities – once you get past the slightly weird syntax, that is. A great
Your First Day of Ultra-Wealth Imagine waking up one day and being told: “Every second you’re awake, you can spend £50.”What would you spend it on? If you’re like me, your first thought would be
Guard Clauses and the List Monad Some Haskell code on StackOverflow with appealingly concise syntax turned out to be surprisingly deep, and teach me a new type! Here's the code (collated from https://stackoverflow.com/a/20644753): So by
Monads and Do-Blocks in Python Functional programming is a bit like writing regular expressions, in that the effort-expended-per-character is really high. It’s always annoyed me how Enlightened Functional Programmers online love to use bizarre names like “ap”
Hashtables in C: Table Doubling After revising some data structures recently, I thought it'd be an interesting challenge to write some of them in C. I started with a linked list, and then went on to use the
CSS Recreations Today I recreated some designs from Polaroid and RadioShack. As ever, I don't load images for any of these designs – everything is styled with fonts and CSS. Here are two designs roughly taken
Cross-Platform Resume for YouTube I've been wanting a feature in YouTube for months now, and finally got to the point where I just decided to make it myself. The problem: if I'm playing a video on my
Pose, FLIP, Animations! I've been learning to use Hooks, and I thought it'd be a good time to get my head around the popular Pose declarative animations library. Animations have always been something I've shied away
60fps Parallax Animation with SVG Try it out here!I mainly made this because I wanted to try out drawing in Illustrator, but I've also wanted to try recreating Github's cursor-based parallax (seen on their 404 pages) for
Animating Lines with SVG I've never actually used SVG before, which seems like a gap in my knowledge – I'm pretty comfortable with CSS now (see my recreation of a MacOS security modal), and I've tried my hand
Camera Automation I bought a camera yesterday. This is the camera I bought: Sony WX-500 Compact Camera. Credit: sony.co.uk.I bought it because I wanted something cheap to point-and-shoot amateur photos of fjords,
Crazy Idea #78: Full-Stack Elm Architecture I've recently dug into using Redux with React apps, and it's got tons in common with Elm – both have an 'immutable state tree' and represent changes to that tree using Actions. Elm has
TinyBuf: Binary Serialization After reading some of Google's ProtoBuf documentation, and working extensively with Apache Thrift, I decided I could learn most effectively by creating my own proof-of-concept binary serialization framework. I would work in a
Functional Inventory Design I'd like to write a story game in Elm, along the lines of my previous browser game 5:28. However I'd like to design it with a modern frontend framework, rather than stringing
Calculating Logarithmic Semitone Cents While writing a blog post about phone keypad sounds, I realised I'd never done the maths to work out how semitone cents would be split up logarithmically. So here's a run-down of how
Phone Keypad Tones I've always been interested in phone keypad sounds, so I tried to replicate them. Here's what I managed to work out just by ear: Each key has a unique sound The unique sound
Bewitching the Coding Interview A spoof. With thanks (and apologies) to Aphyr. The interviewer greets you as you step into the bright, open workspace. Sunlight streams onto his rugged, handsome face as he introduces himself. “Kris”, he
How to Render a Fractal, Fast Recently I've been working on a project I've called Brot, after the Mandelbrot set. It started out as a simple image renderer, but soon blossomed into a full-scale video zoom renderer: The code
$1.20: A Serverless Spending Tracker Since moving to London, I've built a handful of tools to help me keep on top of my finances. They're not finished, or even particularly polished, but they're incredibly handy! Partly as a