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
Profiling Hashtables in C Hashtables are a neat way of storing (key, value) pairs with fast lookup, insertion and deletion times. I've written a simple implementation of a hashtable with a view to making an extremely easy-to-understand
Google Cloud Functions In the spirit of fairness, since I've spent so much time using AWS Lambda functions, I thought I'd give Google's latest offering a try. However, following the instructions to create a simple cloud
Preprocessor Polymorphism The preprocessor included with C compilers is a strange beast. By far its most common use is to #include various header files, and to #define static variables for later use. But there's other,
Swing in Seven Swing can make or break a track. Have a listen to this clip of a drum beat without any swing: Sounds kinda lame, right? Let's ignore the sounds for a second and concentrate
Build Your Own Enum! After programming in Java for altogether too long, I've developed a healthy appetite for the humble Enum. There's a problem, though: Python's enum is ugly. Ugly as hell: class Something(Enum): x = 1
DockerBox I've had an idea brewing for a while. I'd like to be able to use a single command, available on any device with SSH, to load a fresh image of any operating system
Side Project: Text Game So I've finally got around to making a text game! Sort of. Instead of running in a text-based environment like a console and accepting English-language commands as input, I made the decision to
Goroutines and Concurrency I recently watched Rob Pike's talk on Concurrency Patterns in Go, and was really impressed by how easy it was to make solid concurrent code without relying on threads, mutexes/locks or anything