ActivityStreams is the fediverse’s base data model. It’s why we have things like Actors, Objects and Activities. It models social interactions as an actor-based system. ActivityStreams is canonically exchanged in JSON-LD compacted document form, which is JSON with some special keys for the “linked data” aspect. JSON-LD has two(-ish) forms: Compacted document form, which looks like your typical JSON. Expanded document form, which looks more like a tree of nodes. People tend to prefer compacted form because it looks more like the JSON payloads you run every day.
Read MoreRunning Mastodon for integration tests
For a personal project I’m working on, and for GoToSocial, I’ve wanted to run Mastodon locally to write integration tests against. Forgejo wants this too, to test their federation code. The problem is, you want to do that against a Mastodon instance that runs in “production” mode (i.e RAILS_ENV=production), except without all the TLS and https URL generation turned on. But in production mode, you normally can’t turn this off. This is good, and safe, and sound.
Read MoreA practical guide to Go's reflect package
Go’s reflect package is very powerful and very useful, but I’ve always struggled to wrap my head around it. The package comes with examples, but I’ve always felt the need of a more practical walk-through that stitches everything together. If you haven’t read it yet, the Laws of Reflection post is very useful. But let me propose a different first law of reflection: You Will Fuck It Up. You’re knee deep inside Go at runtime, rewriting part of the program that’s executing.
Read MoreSelf-hosting things again
It’s 2025. The world is not doing great, and as a queer person Anglosphere tech corporations are now something I have to actively consider as part of my threat model. This was already a problem for many folks in the queer community, I was just lucky enough that in my case the risk remained acceptable. With a fascist regime installed in the US and tech corporations gleefully embracing it, depending on those corporations is no longer an option.
Read MoreRemoving AI stories from tech news aggregators with uBlock
I like to use tech news aggregators like HN or Lobsters to find new things to read. There are often interesting things on there, and they’ve helped me discover many blogs that I end up adding to my feed reader. I avoid the comment section though, and have uBlock rules that remove them and the login links. This has helped me unlearn the habit of checking the comments doing wonders for my mental health.
Read MoreA low-carb, sugar-free, gluten-free cake recipe
Today, the topic isn’t tech but delicious delicious cake. Because of $reasons I need to watch my bloodsugar and keep it from spiking. I can’t inject insulin to counter spikes. This means that most bakery or store-bought sweets, pastries, ice cream etc. are off-limits for me. They’re not worth ending up in a coma. But I do like a sweet from time to time, so I’ve developed my own recipes. I’ve finally managed to nail a good cake, so I thought I’d share.
Read MoreFairy: a library for building friendly CLIs in Go
Why did I build my own when there’s a hundred of these already? Because I don’t like how most of the others work. Fairy 🧚 only uses Go’s flag package underneath. There’s no custom flag parsing involved, but it can do some things Go’s standard library package doesn’t provide. I quite like Go’s flag package. I don’t care that it doesn’t do GNU-style opts, that it’s not perfectly docopt etc. It fits my needs 95% of the time and unless you need a hyperscale Cloud Native CNCF approved CLI it probably is enough for just about any project.
Read MoreSetting up OpenTelemetry in Go
This blog post is technically incorrect. It only aims to give you an in practice correct enough understanding of using OpenTelemetry in your Go projects and how to set it up. Lets dive in. Update 2024-05-02: Code has been updated to use the autoexport package to simplify setup a lot. Concepts There are a few concepts we need to be aware of: Providers. Meters and Tracers. Metric instruments and Spans. Exporters.
Read MoreMigrating to Codeberg
Github has always been a very enticing code forge. You get a lot of things for free. Code hosting, decent issue management, Gists, Pages, CI etc. Of course, all of these things are also there to make the service more sticky. They’ve moved the baseline expectations of the services a forge should provide for free so far up it’s hard for entities without VC capital or Microsoft’s war chest to provide an enticing, competing offer.
Read MorePana: a new Go library for the Fediverse
Getting started with building on the fediverse can be a big chore, there’s a lot to learn and handle. Pana is a new library in Go to help simplify things. It provides the buildiing blocks for handling ActivityStreams messages, the message format used between servers to exchanges actvivities and enable federation. A picture is worth more than a thousand worth, and good examples are worth more than me trying to convince you with words or pictures.
Read More