Back to home

Archive

Writing and Essays

A collection of posts from my previous blog, spanning engineering, leadership, and experiments.

Browse by tag

Blog Post

Updated site and new blog

Hello, World. This site is still static HTML but now built with 11ty and hosted on Cloudflare Pages, rather than being handwritten HTML on GitHub Pages. This means it's easier for me to add content and will hopefully res…

Read more
Today I Learned

AWS Service Comparison and Cheat Sheet

Note: these were created primarily with ChatGPT, Claude and Gemini, with a bit of back and forth prompting, pasting in AWS docs and correcting things. AWS main topology and infrastructure options Feature AWS Regions AWS …

Read more
Today I Learned

Introduction to TypeScript

I recently started work on a new project and started transitioning the JavaScript into TypeScript, so thought I'd write some notes. TypeScript is made by Microsoft and basically enhances JavaScript by adding a whole load…

Read more
Today I Learned

Dokku Setup

This is an overview of how to get a server set up running Dokku, with wildcard domains. Out the box Dokku image from DigitalOcean: https://marketplace.digitalocean.com/apps/dokku Locally Git setup: DOKKU_HOST=ssh.example…

Read more
Today I Learned

Distributing Python Packages on PyPI

I ran through Packaging Python Projects today to get Clipea installable with pip install clipea-cli. (I originally wrote Clipea in PHP to get it working quickly but someone kindly ported it to Python.) pip packages are h…

Read more
Today I Learned

Making a custom "GPT" for ChatGPT

First thing's first: GPT stands for Generative Pre-trained Transformer but for some reason OpenAI have reused the name for one of their products. What's a Generative Pre-trained Transformer really? These are artifical ne…

Read more
Today I Learned

How til.dave.engineer works

The site is a basic Eleventy site. You can install with npm install and build with npm run build. Use npm run serve for development. Most of the code that turns the repo of markdown files into a website is in .eleventy.j…

Read more
Today I Learned

Getting started with Amazon Lex

Today, I was setting up an Amazon Lex chatbot and came across a couple of challenges. In simple terms, Amazon Lex is like a more structred version of ChatGPT. It uses advanced natural language understanding (NLU) and aut…

Read more
Today I Learned

CSS Variables

Revisiting CSS: A Pleasant Surprise I don't often write CSS. To my surprise, I discovered that modern CSS now has its own native variables, known as Custom Properties. These are now widely supported across all major brow…

Read more
Today I Learned

Tidy up local and remote branches in git

Your remote tracking branches This cleans up the big origin list you get when you do git branch --remote git remote prune origin Local branches that have been merged This removes your local branches that have been merged…

Read more
Today I Learned

Vector Databases Overview

I was having a look around at vector databases to have a play with document search and realised that suddenly there's support all over the place for them, even from the big players. ELI5: geo databases query 2 dimensiona…

Read more
Today I Learned

GPUs are non-deterministic

This means they can do the same calculation twice and get different answers. Be careful if you use GPUs for security related things. This is because of how floating point arithmetic works in CPUs/GPUs - the same thing th…

Read more
Blog Post

Traits with interfaces

In PHP, Traits can't implement interfaces. They can, however, include abstract methods. These methods then need to be implemented by the concrete class that implements the trait. This allows a trait to provide some boile…

Read more
Blog Post

Thoughts on PSR-7

PSR-7 contains interfaces for HTTP messages. These are like Symfony Kernel's Request and Response interfaces. Having these new interfaces would be great for the PHP community but there's a couple of issues with their cur…

Read more
Blog Post

Notes on designing through mocking

My notes on Everzet's talk "Design how your objects talk through mocking" at PHPNW14 Everzet's Original slide deck Code sample here are using Prophecy to create test doubles Different test doubles: Mocks, stubs…

Read more
Blog Post

Strace

Quick strace command that I use all the time to see what files a process is opening: strace -f <command> 2>&1 | grep ^open Really useful to see what config files something is reading (and the order) or to see what…

Read more
Blog Post

Conway’s Game of Life in Canvas

I haven’t done much with Canvas, so I thought I’d experiment by making Conway’s Game of Life with a little JavaScript. Conway’s Game of Life is based on a grid of cells, which are either alive or dead. It has 4 simple ru…

Read more
Blog Post

Generators in PHP 5.5 (with PDO)

As the first alpha of PHP 5.5 has been released, now is a great time to play with its new features. The first new feature is generators. Generators are like very simple iterators. PDO’s PDOStatement class implements Trav…

Read more
Blog Post

PHP coding standards and style guides

The PHP Framework Interoperability Group (PHP-FIG) are a group representing most of the big names in the PHP world such as Zend and Symfony. The group has formed to encourage PHP frameworks to be more interoperable. They…

Read more