Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Quick Swap Data SIM Shortcut on Android

· 1 comment · 200 words · Viewed ~590 times


List of settings activities.

I have a dual SIM Android phone. When I call or text, I get a choice of which SIM to use. But there's no quick way to swap which SIM is used for data. There used to be a built-in settings tile on stock Android, and some manufacturers still have it, but Google's Pixels don't. So here's how to make a (fairly) quick shortcut to swap between data SIMs. First, get the brilliant open source Activity …

Convert Shotwell Photo Metadata to Digikam Metadata

· 100 words


Linux bash terminal icon.

Mostly notes to myself. Shotwell stores most of its information in a database. Which I lost. Because I'm an idiot. But a bunch of metadata is also stored in the image's EXIF metadata! Most importantly is the "Original File Name" which should become the "Description" in DigiKam. Unfortunately, there's no way to copy those values automatically on import. So here's a one-liner which will read…

You don't need an API key to archive Twitter Data

· 3 comments · 1,700 words · Viewed ~2,720 times


The Twitter logo.

Apparently there's no need for IP laws any more, so here's a way to archive high-fidelity Twitter data without signing up for an expensive API key. This is perfect for academics wishing to preserve Tweets, journalists wanting to download evidence, or simply embedding content without leaking user data back to Twitter. Table of Contentstl;drBackgroundEmbed CodeAPI CallOptionsOutputTweet With…

An opinionated HTML Serializer for PHP 8.4

· 800 words · Viewed ~958 times


The HTML5 Logo.

A few days ago, I wrote a shitty pretty-printer for PHP 8.4's new Dom\HTMLDocument class. I've since re-written it to be faster and more stylistically correct. It turns this: <html lang="en-GB"><head><title id="something">Test</title></head><body><h1 class="top upper">Testing</h1><main><p>Some <em>HTML</em> and an <img src="example.png" alt="Alternate Text"></p>Text not in an…

Pretty Print HTML using PHP 8.4's new HTML DOM

· 1 comment · 950 words · Viewed ~739 times


The PHP logo.

Those whom the gods would send mad, they first teach recursion. PHP 8.4 introduces a new Dom\HTMLDocument class it is a modern HTML5 replacement for the ageing XHTML based DOMDocument. You can read more about how it works - the short version is that it reads and correctly sanitises HTML and turns it into a nested object. Hurrah! The one thing it doesn't do is pretty-printing. When you call…

Create a Table of Contents based on HTML Heading Elements

· 1 comment · 1,200 words · Viewed ~421 times


The PHP logo.

Some of my blog posts are long. They have lots of HTML headings like <h2> and <h3>. Say, wouldn't it be super-awesome to have something magically generate a Table of Contents? I've built a utility which runs server-side using PHP. Give it some HTML and it will construct a Table of Contents. Let's dive in! Table of ContentsBackgroundHeading ExampleWhat is the purpose of a table of…

ManyTag Colour eInk Badge SDK - Minimum Viable Example for Android

· 500 words · Viewed ~382 times


Screenshot of an app.

Last year, I reviewed a Four-Colour eInk Name Badge - the ManyTag HSN371. The hardware itself is perfectly fine, but the Android app isn't great. It is complicated, crash-prone, and not available in the app-store. After some back-and-forth with the manufacturer, they agreed to send me their Android SDK and documentation. Sadly, the PDF they sent me was riddled with errors and the software…

Change the way dates are presented in WordPress's admin view

· 1 comment · 200 words · Viewed ~235 times


The Logo for WordPress.

WordPress does not respect an admin's preferred date format. Here's how the admin list of posts looks to me: I don't want it to look like that. I want it in RFC3339 format. I know what you're thinking, just change the default date display - but that only seems to work in some areas of WordPress. It doesn't change the column-date format. Here's what mine is set to: So that doesn't work. …

Add a custom icon to Auth0's Custom Social integrations

· 350 words


Screenshot showing an ID field.

This is so fucking stupid. There is no way to update the logo of a custom social connection on Auth0 without using the command line. On literally every other service I've used, there's a little box to upload a logo. But Okta have a funny idea of what developers want. And, to make matters worse, their documentation contains an error! They don't listen to community requests or take bug reports,…

Change WordPress Fragment Links in RSS Feeds to be Permalinks

· 1 comment · 50 words · Viewed ~242 times


A glowing red mushroom cloud caused by an atomic bomb.

Here's a knotty problem. Lots of my posts use URl Fragments. Those are links which start with #. They allow me to write: <a href="#where-is-this-a-problem>Jump to heading</a> So when someone clicks on a link, they go straight to the relevant section. For example, they might want to skip straight to how to fix it. Isn't that clever? Where is this a problem? This works great when someone is…

An Easy Guide To BlueSky Verification

· 14 comments · 500 words · Viewed ~1,670 times


Change Handle screen.

The new Twitter-Wannabe BlueSky has an interesting approach to verifying accounts. Rather than you sending in your passport, or paying a 3rd party, or bribing an employee - you can self-verify for free! This opens up verification to small organisations, individuals, and anyone who wants to prove who they are. Brilliant! Verification means that your @username will change to @Your.Website.com -…

A simple and free way to post RSS feeds to Threads

· 1 comment · 550 words · Viewed ~330 times


Threads logo.

Threads is Meta's attempt to disrupt the social media landscape. Whether you care for it or not, there are a lot of users there. And, sometimes, you have to go where the audience is. Here's how I build a really simple PHP tool to post to Threads using their official API. This allows you to send a single status update programatically, or regularly send new items from your RSS feed to an account. …