Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.
Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.

We Made the Paper Jan. 14, 2020 in Flute, Music, Photos

We Made the Paper We Made the Paper CLoseup

That was Over Quickly Jan. 9, 2020 in Photos

That was Over Quickly

BathTub Orchestra's Christmas Celebration Dec. 4, 2019 in Flute, Music, Orchestra, Snow, Videos

BathTub Orchestra's Christmas Celebration BathTub Orchestra's Christmas Celebration

Today I performed in BathTub Orchestra’s Christmas Celebration. I had a great time playing the flute. Here is a playlist from the night.

Hack Automata Oct. 17, 2019 in Csharp, Games, Unity

Hack Automata

Hello Lisbon Sep. 2, 2019 in Photos, Portugual

Rua Augusta Arch

Jekyll Category and Year Pages Without Plugins Mar. 20, 2019 in Jekyll, Text, Tutorial

Jekyll is fantastic, easy to use, and extensible. However, some Jekyll hosts such as GitHub Pages do not allow people to use custom plugins - and I want category and year pages. But rightly so. Allowing custom plugins would require hosts to allow users to run arbitrary Ruby code on their build servers and possibly create a mess. This problem is solvable, but it’s ultimately simpler to just ban them entirely.

This constrained environment forces you to get creative. On this blog I use the fantastic jekyll-compress-html template which minifies the very post you are reading. I have written by own template to automatically replace standard markdown or HTML images with lazily loaded ones. And finally, I have written a small (it’s only a hundred or so lines ;) ) Makefile to automatically, among other-things, generate year and category pages:

# Find categories and years
CATTARGETS  = $(shell grep -h '^categories:' -r _posts/ | awk -F ':' \
              '{print $$2}' | tr ' ' '\n' | sed '/^$$/d' | sort | uniq | \
              awk '{print "categories/"$$1".html"}')
YEARTARGETS = $(shell find _posts/ -regextype egrep -regex '.*/[0-9]{4}.[^/]*' \
              -printf '%P\n' | cut -c-4 | sort | uniq | \
              awk '{print "years/"$$1".html"}')

# Generate category pages
cat: cat-clean $(CATTARGETS)
categories/%.html: _templates/category.html
	cp $< $@
	sed -i 's/#####CATEGORY#####/$*/' $@

# Generate year pages
year: year-clean $(YEARTARGETS)
years/%.html: _templates/year.html
	cp $< $@
	sed -i 's/#####YEAR#####/$*/' $@

To use, simply create _templates/category.html and a _templates/year.html templates and run make cat year. The code assumes your posts start with the date and they are stored in the default _posts/. When run #####CATEGORY##### and #####YEAR##### will be replaced with the templated value.

I̵n̵t̵e̵r̵a̵i̵l̵i̵n̵g̵, No Flying into Malaga Mar. 11, 2019 in Photos, Spain, Travel

I briefly flew to Malaga.

In The Sky On The Streets

In The Sky. On The Streets

By The Beach Time To Sleep

By The Beach and Time To Sleep.

The Next Day Buried Remains

The Next Day and Buried Remains.

Hello There Towering Castle

Hello There, a Towering Castle.

Inside Are Gardens A View Of The City

Inside Are Gardens and a View Of The City.

A View Of The Town

A View Of The Town

Ugshot Squirrel Cats

Ugshot. Squirrel? Cats!

Obligatory Photo Reading Till Dusk Giraffes

Obligatory Photo. Reading Till Dusk. Giraffes.

Watching A Protest Listening To The Drums

Watching A Protest. Listening To The Drums.

In The Market

In The Market

Towering Over Cramped Checking Out

Towering Over. Cramped. Checking Out.

Flying Home

Flying Home, the Question is Where Next?

Tittle-Tattle Town Mar. 3, 2019 in Games, Rules, Text

Tittle-Tattle Town is a game where players travel around a small game board graph, and gossip about other players. Each player has a small deck of identically-backed cards, one for each player, and a crib sheet. Start on your starting tile, and collect two gossip tokens.

On your turn, roll the dice, and move up to that many spaces. If you can move you must move. If you land on an occupied space, you must tattle with one person of your choosing on that space.

Tattling: Briefly talk to another player, then secretly choose one of your player cards. Reveal simultaneously. If you…

Continue Reading...

Let it Snow! Let it Snow! Let it Snow! Feb. 1, 2019 in Photos, Snow

Let it snow

Not a great photo, still alive. Have an avatar generator.

25 Days, 25 Languages Dec. 1, 2018 in Text

This year I am going to take part in the 2018 Advent of Code, where each day, two new programming challenges are uploaded to the site. But as I live in the UK and I don’t want to ruin my sleeping schedule for a month, competing for the leaderboard is out of the question. Instead, I am going to challenge myself to use 25 different programming languages.

For this I will treat different versions of the same language as the same language, so no Python 2 and Python 3 solutions. However, I can use C, C++, and C# as they are all different languages, even if they are rather similar syntactically. As for what language I pick on the day, it really depends how I am feeling. If the problem is simple, I am more likely to choose a more complex or unfamiliar language. I’ll be saving some language for when I am really struggling.

My solutions will be posted on GitHub.

Edit: Oops, so that didn’t happen. Not long after starting this challenge I broke my dominant wrist roller-skating, and just in time for Christmas! But anyway, this means that it is unlikely that I will finish this. While incomplete, I am glad I attempted it and will definitely consider using Rust in future projects - it is a nice language.

Get an email when I post, zero spam     Get an email when I post     Newsletter