Hello there!

My own browser extension

Creating your own browser extension can be a good way to take back control over your user agent so that it can be made to work the way you want instead of the way they want. A lot can be accomplished with just basic JavaScript and DOM manipulation. In this post I will show some stuff I added to my own extension that I have been using for several years now.

Publishing RabbitMQ messages from PostgreSQL

One quite useful thing is the ability to publish something to a message broker such as RabbitMQ directly from a database like PostgreSQL. This article will show how this can be done using some simple Node.js bridge code so that whenever a row is inserted into a table in PostgreSQL, a message will be published to RabbitMQ in a safe and reliable manner.

Acyclic and directed graph in Postgres with the LTREE extension

Acyclic directed graphs are a very useful concept that has many real world applications: hierarchical groups, organisation charts and product categories are just a few of all the situations of where they can be essential.

This article contains a complete demonstration of an acyclic and directed graph implemented in Postgres mainly by using the LTREE extension and table triggers. It also contains some useful queries related to the graph such as getting all parents of a node and more.

Degoogle: Swapping Analytics for Fathom for visitor statistics

I’ve resolved to become more privacy conscious during 2020. I’m going to do this mainly by decreasing or eliminating my use of Google products. This post is the first of what is to become a series were I explore both free and paid-for alternatives to the suite of online products that Google offers.

First up we are going to look for a replacement for Google Analytics. Analytics is a tool that offers statistics and insights into what your visitors are doing on your websites. By some accounts more than 50 % of all websites use Analytics – a literal treasure trove of data about what people are doing on the internet given away by site owners to a mega-corporation for free.

Let’s see if we can find something else.

Celebrating 10 million downloads for Jayson

Just posting a quick headsup that my open-source node.js library Jayson this month reached a cumulative 10 million downloads in its 8 years of existence.

Jayson is a library that enables easy setup of a JSON-RPC client and server in node. I wrote it for internal use at a previous job eight years ago. Today it is the number one tool for JSON-RPC implementations in node, and at the time of writing gets approximately 500 000 downloads/month.

Broadcasting row updates with PostgreSQL triggers

Here’s some SQL that might be useful if you are working on an application that is backed by PostgreSQL. I’m going to show you how to get the set of changed columns inside of a UPDATE trigger handler that can then be used to send out a NOTIFY. This notification could then be picked up with a PostgreSQL LISTEN and easily passed on to browsers connected to your application via a web socket. This allows your clients to stay updated of any changes to any rows without resorting to inefficient polling.

GDPR in Sweden: How Sweden's biggest websites are communicating compliance (and how your business should not!)

Note: this article was initially published on tedeh.ltd but was moved to this site in June, 2022.

In this article we will investigate ten of the largest websites in Sweden as a casual visitor. We will have the rights given by the EU General Data Protection Regulation (GDPR) in mind as we attempt to describe the manner in which the subject websites inform us of our rights, and the specifics around how it is done (pop-ups, buttons, links, terminology, etc.)

Finally we will give some recommendations on how businesses with an online presence can best communicate the rights granted under the GDPR to their European visitors and customers. These recommendations will have what is best and most clear for the user in mind, and will be supported by our findings.

Simple shell script replacing Pingdom for checking domain health

Pingdom is a service that automatically checks the health of your domains. It returns up/down information, response times, status codes and more. If something goes wrong it sends you notifications. Here I’d like to show a simple shell script that I’ve been using that replicates some of that functionality and notifies by email when something goes wrong.

Part 1: How to architect a medium sized node.js web application

This is the first in a two part series of how to architect a medium-sized node.js web application. It is designed for testability and long-term maintainability. Part 1 is going to be a high level overview of the directory structure and how it fits together. In part 2 (not yet finished) we’re going to look into some specific highlights of the architecture.

Manual Stripe invoicing for the glorious benefit of your business customers

Stripe is a great service — it enables you to easily start accepting card payments in a multitude if currencies. But Stripe lacks good support for one feature that is important for many business customers: manual invoicing. In this short article I will show you how I tackled this problem as part of my work with Linknow.