Chris Hannah

Below is a feed of all of my articles, status updates, photos, and essays, enjoy!


My Favourite Use Case for AI

AI seems to have weaved its way into most software developers daily life, whether it's conversational advice, better autocomplete, or even just plain code generation. However, the use-case that I really enjoy is when it can speed-run boring tasks for me.

I don't use AI that much when programming. For me, I prefer it to complete little side quests for me than to get involved in my main work.

My recent use case was for this blog. I change up how I write and publish posts quite regularly, depending on the computer, and tools I want to use. So while I'm using Omarchy on my new Framework laptop, I'm more terminal-heavy than before. So ideally, I'd be able to run a quick shell script on my laptop, and then jump into writing a blog post.

So I gave Perplexity my idea, and then let it come up with a simple bash script to do that very job for me.

#!/usr/bin/env bash

# Exit if no title is provided
if [ -z "$1" ]; then
  echo "Usage: $0 \"Post Title\""
  exit 1
fi

# Get current date parts
YEAR=$(date +%Y)
MONTH=$(date +%m)
DATE=$(date +%Y-%m-%d)

# Input title
TITLE="$1"

# Create slug (snake_case for filename, kebab-case for permalink)
SLUG_SNAKE=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/_/g; s/^_|_$//g')
SLUG_KEBAB=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-|-$//g')

# Directory structure
DIR="posts/$YEAR/$MONTH"
mkdir -p "$DIR"

# Filename
FILE="$DIR/$SLUG_SNAKE.md"

# If file already exists, don’t overwrite
if [ -f "$FILE" ]; then
  echo "File already exists: $FILE"
  nvim "$FILE"
  exit 0
fi

# Write frontmatter to file
cat >"$FILE" <<EOF
---
title: $TITLE
date: $DATE
tags:
  - post
layout: layouts/post
permalink: $SLUG_KEBAB/
---
EOF

# Open in Neovim
nvim +"normal Go" "$FILE"

GitHub Gist

It does the following:

  1. Takes in a single parameter, which is the blog post title.
  2. Creates any required directories.
  3. It uses that title in snake case for the filename, and creates a file.
  4. It uses the title again, but in kebab case for the permalink.
  5. Generates the rest of the frontmatter required for a standard post.
  6. Opens the new file in Neovim.

Watch it in action:

I'm sure I could have written this script myself, but I didn't want to. This is the sort of task that I put off for weeks, and maybe never get around to doing it. So being able to get AI to do this for me, makes my life much easier.


I only just thought about this, but I should probably make use of my own Text Case CLI tool, and also format the title properly. That can be in the next version.

I didn't run this far to only run this far.
—The back of a guys t-shirt in Barcelona, Spain.

I didn't get this at first, but now I really like it.

Journeys Through Glass

I'm pleased to announce a new project of mine, Journeys Through Glass. It is a new blog by myself, where I will document my journey using the iPad as a primary device. From my introduction:

Around two weeks ago, we got to see the iPad get a hint at a new life, in the form of iPadOS 26. That made me wonder if this could spark a revival of my usage of my iPad. - "The Start of a Journey"

My first few posts:

I'll still be posting here, but anything related to my iPad journey will be posted on my new blog!

Weeknote #1710

It's been a bit of a busy week at work. We're at the stage in our project where we're finalising our own functionality while also doing integration testing with a bunch of other teams and domains. A very tricky time.


Aside from work, I've been trying to get out in the garden a bit more. I've cut the lawn, overseeded where there were gaps, and tidied up some of the plants to make it look a bit more presentable. There's still more to do, but I think 30 minutes here and there will be enough.

Alongside me in the garden are some tadpoles...

My girlfriend got hold of them from someone elses pond recently, so we decided to put them in a little pond I made a while back. It's a half of a whiskey barrel, that I originally used as a plant pot, until I realised it was watertight as the plants were getting waterlogged constantly.

A few rocks, plants, solar-powered fountain later, we had a half-decent miniature pond.

I also bought five snails from eBay last year, and they've done fantastically this year. There must be hundreds of them in there now. I thought they would have started eating the plants, but the plants are still growing well and the water is always clear.

Right now, the snails are cohabiting well with the tadpoles, which have just recently started to grow legs!

I'm very much looking forward to my frog army this summer.

Weeknote #1709

After a week in Lanzarote, I'm back in the UK.

It was definitely good to get away for a bit. Especially as it's a busy time at work at the moment, so a little break was needed.

But that does mean it's now straight back to the grind. Getting home at 04:30 this morning and starting work at 08:30 wasn't the greatest feeling ever.


While I was away I took two laptops (like most people do I assume), one ThinkPad X1 Carbon with a fresh Arch/Hyprland install, and my 14" M1 MacBook Pro. I mentioned this in the last weeknote, and it continued for a few days, but in the end I got tired of the barebones feel and went back to my Mac.

At least for now, I think I'm more suited to the Mac. Especially when I don't have much time between working and having a baby to look after.


There was one fun project I worked on every now and then while I was away. I was working on a website design, which had sort of an old retro technology feel with analogue buttons. It's not perfect, and it doesn't fit what I have in mind just yet. But I guess I may as well show a quick preview of the header design, which is a title, two different menu designs, and a random power LED.


As for entertainment, because of the flights to/from Lanzarote, I was afforded the time to watch some "TV" for a change. Which, unsurprisingly, means I just binged a load more Yellowstone. I watched four episodes on the flight back to London, and it puts me halfway through the fourth season. I reckon I could be done by the end of this week if I use my commute time wisely.


Speaking of a commute, that will be changing soon. After over eight years of working at my current job, travelling back and forward from my town into the exact same office, we're finally moving.

The commute time doesn't change much, but I'll now be working near the Tower of London, which is a nice area, and should be a very welcome change of scenery.

We'll start packing up over the next few weeks, and then at the end of May, we're out! Then, after around two weeks working from home, our new office will be ready, and I'll hopefully have a desk with a good view.

Weeknote #1708

I'm writing this weeknote in a different location for a change. Right now, I'm on holiday in Lanzarote.

While I'm here, along with relaxing and spending some time with my family, I've also taken along my trusty ThinkPad[1]. Naturally, this means I've been tinkering with a fresh Arch install, and configuring things like Hyprland, and waybar.

It's a fun experiment, but it will also help me determine if I can both make Arch look and work well for me, and the same time ensuring it is something I can use full-time.


Still on the topic of laptops, I got my new work machine last week. A 16" MacBook Pro with a M4 Pro chip, 500 GB storage, and 24 GB memory. I've been setting up as per my recent guide, and also discovering things I missed off. I can't comment on the performance as I think I've only barely scratched the surface so far. However, I do feel like the keyboard has been improved since the M1 model?


Anyway, I'll keep it short this week. I've got a sunburn to catch.


  1. Lenovo X1 Carbon (5th gen.) ↩︎

Weeknote #1707

Some more laptop updates this week:

Work

My new M4 Pro 16" MacBook Pro has been ordered, so once that has arrived, I will officially purchase my current work laptop. The current price is around £425, which isn't bad, but there's also a change it will decrease as time goes on.

Personal

My goal of finding a new personal machine is still all over the place. I was talking to my brother about pricing up my new Mac (he gets a discount through work), and then I got cold feet again. That was also helped by Pewdiepie's unexpected video about his Arch installation. That's now on hold for a bit while I make a decision. but for now I'll start using my ThinkPad again, as it's running Ubuntu, so I can get another feel for Linux, and decide if it's something I want to run long-term.


Speaking of my work laptop, I've created a new living document here on my blog, which I will use to detail my entire configuration of my work Mac. It's obviously for my own benefit, but I guess it doesn't hurt having it on my site.

Maybe I'll do the same for my personal laptop, whatever that will be.


As for a final thought, as I was looking at my 9-month old daughter recently, and it still amazed me that I (and my partner) created her. So I wondered whether that feeling ever goes away. I hope not.

Weeknote #1706

Note: this entry covers the past 2 weeks.

Making Bread

I had the idea recently that I wanted to see if I could bake bread from scratch. Nothing too elaborate or requiring any special equipment or techniques. But my goal is to be able to quickly throw together the typical ingredients (flour, water, salt, yeast) in the right ratio, cook in my airfryer, and then have decent bread rolls.

I'm using no real recipes, apart from a quick ratio I found on my first google search. I've since tried 4 times, with varying cooking times, temperatures, and also liquids (Stella Artois has worked the best so far).

So far they've not been perfect. Edible, but not perfect. If I ever make a really good one, I'll share a photo.

PokeGuessr

I wanted to do some programming, and thought I could make a fun little game. So I made a guessing game in Node.JS where you can try and guess all 151 original Pokémon.

Find it on GitHub

Chocolate

Like most people, I've just taken part in the yearly exchange of overpriced chocolate. Which means I now have enough chocolate to last me for quite some time.

Laptops

My work laptop has reached it's ripe age of 3 years, which means I'm able to purchase my laptop at a discounted price of £427. Obviously I don't have to buy my laptop, but it's a good way to get a cheap laptop and to also force a replacement.

A good condition 16" MacBook Pro (M1 Pro) with 500GB storage and 16GB memory for £427 seems a good price to me, so I'll be starting the purchase process shortly. I expected I'll just resell with the same price to someone in my family.


I wrote a short post the other day about my ideal work laptop.

Needless to say, I want my next work machine to be very intentionally built and customised. I want to build the most efficient machine for my work.


As for my personal laptop, I still haven't ordered my new Mac. Which, like I said on Mastodon, increases the likeliness of me ending up with a Framework machine instead.

Minecraft

This may become a trend. Here's an updated view of my current humble base in Minecraft.

I have decided that in this world, I won't build any elaborate strucutres or designs that much, instead it will just be practical buildings that may also look nice.

My Ideal Work Laptop

I've been going through the process of replacing my laptop at work recently, and it made me think about what my ideal laptop would be. If there were no restrictions regarding company policy, support, etc.

For the record, I'm currently using a 16" MacBook Pro with an M1 Pro chip.

Forgetting the hardware aspect, when I really thought about the software I used at work on a day to day basis, it really came down to these primary applications:

  • Mail
  • Chrome
  • IntelliJ - 99.9% of the code I write is Java, IntelliJ is the best IDE for this.
  • DingTalk - Think of this as a Teams/Slack alternative. This is where we have our real-time communication, calendar, video calls, alerts, reports, task management, etc.
  • Ghostty - My current terminal application.

In a dream world, I'd have a laptop setup so minimally, that each of these were always open, set to be used on their own workspace, and have nothing else installed. This sort of setup would be ideal for a Linux machine, where I could have a real control over how everything is configured, minimising distractions, etc. [1]

However, our main application, DingTalk is only available on Windows and macOS...

I have been tempted to switch to Windows, mainly because it would enable me to use Linux via WSL. But I just can't do it.

That leaves me with macOS...

I wouldn't say it's full of bloatware, but depending on what you want your machine to do, it can feel like it sometimes. Or at least it can feel like the system is fighting you whenever you want to use your machine in the "wrong" way.

One example is how workspaces (Spaces/Desktops in macOS) work. For example, you can't natively see what space you are in, moving between the spaces isn't instant, and if you make an application full-screen, it moves to a newly created space. So I have to use Spaceman to keep the space number in my menu bar, and make sure I don't use the native full-screen option. On Linux, all of this would be available and customisable.

However, as I've discussed above, macOS is my only option for work at the moment. So while I won't make any big changes to my current machine, when my new one comes, I'm going to be very intentional about my file structure, software I use, key bindings, etc.

I suspect some of this may overflow into my personal machine setup. But the benefit of my work machine is that it only serves a few purposes: communicating with my team, writing/reading documents, and writing Java code.

Hopefully that means building out my next machine should be relatively straightforward.


  1. This is the main reason why I'm still not 100% on what my next personal laptop should be. I'm 99% sure I will end up with an M4 MacBook Pro. But while I haven't ordered it, there is still a chance I'll fully try out a Linux machine, such as a Framework laptop. ↩︎

Weeknote #1704

My search for a new laptop bag is back on...

Last week I was pretty set on getting a new small laptop backpack for work, seeing as my plan was to downsize to a 14" MacBook in the near future.

However, after talking to our IT department last week, I was told that we have 2 models to choose from. The base model 14" M4 MacBook Pro with 16 GB memory, or the base model 16" M4 Pro MacBook Pro with 24 GB of memory. Needless to say I settled with the 16" model, as it will have to last me a few years.

It will be a bit harder to find a backpack that holds this laptop, but at the same time is as small as possible. Most of the options that fit a 16" laptop seem to built around fitting your entire life in a single bag.

Some changes at work

It's an interesting time at work, since I've now got a new manager. There was an internal rotation of managers between 2 teams, and now we need to go through the various phases of handovers between managers, planning for the future, and also the short-term changes that both managers will want to implement. I'm sure my new manager will want to put her stamp on how we do things, and I eagerly await what it will be.

Yellowstone

Yep, I'm still watching Yellowstone. I completed season 2 last week, and I'm already stuck into season 3!

And I've only just discovered two prequel series, 1883, and 1923 which I will queuing up once I've completed Yellowstone.

Minecraft not so forever

So I've been playing this Minecraft world for a while, but I got to a point where I had some resources collected, some basic farms, an okay base. But I died just a few too many times. So I decided to make another forever world, and start again from scratch.