Categories
Snippets

Dealing with spaghetti code in PHP: Using anonymous functions to extract pieces of template code

Recently I’ve been helping out a friend with trying to make sense of some code and how to modify it to work well with asynchronous calls to the backend. A bonus would be to be able to write it in a more modular and reusable way. The code is a WordPress plugin that was written […]

Categories
Snippets Technology

Setting up a YubiKey for Git commit signing

I’ve been using a YubiKey as a 2-Factor Authentication key and to sign my Git commits. Until a few days ago I’ve been using a YubiKey 4. Since my current computer doesn’t have any USB-A ports, I’ve been juggling a USB-A-to-USB-C adapters in my backpack and using the key has been a hassle for the […]

Categories
Homelab Snippets Technology

Snippets: Running a local/private swarm Docker image registry

Today I was trying to generate a Docker image from a Node.js project and I wanted to deploy it on my local test swarm. Unfortunately if one builds a local Docker image, this image is stored and accessible only to the node it was created on and the other swarm nodes can’t access it. The […]