Coding, crazy projects, modelling, leisure, the occasional travel info or product review. It’s all inclusive here; just bring your own coffee.

Recent Posts

WorkOutDoors: The workout app I would have written for myself

8 minute read

Ever since I got my first Apple Watch, I looked for apps to track workouts. In the beginning, any app would do. The most important thing was to give me feedback on how my workout was going; all the actual work was being done on the iPhone. Over time however two things changed.

Performance of a Go library (fzf-lib) in the browser

42 minute read

In past posts in this series, I looked at how to convert a Go library in order for it to work in the browser. We used both the standard go compiler and TinyGo to compile Go code to WebAssembly, and we used GopherJS to compile Go code to JavaScript. If you did not read that post, I very much advice you to do so now; this post builds on that one, and readers are assumed to know the information in that post

Converting SVG into PNG

5 minute read

In one of my previous posts I mentioned that I was still looking for the best way to convert SVG into PNG. If you just Google “Convert SVG to PNG” you will get hundreds of hits, from Inkscape, to online tools, to photo editors that can import SVGs (I know Pixelmator Pro claims to support SVG imports). For simple SVGs these options may work, but I’m tend to explore the boundaries of what is possible in SVGs. Also, if you offer to convert an SVG to an PNG, you better (at least) offer me a way to specify the resolution that I want my PNG to be; you cannot just assume that the viewBox of the SVG says anything about the resolution it’s meant to be shown at.

Using a Go library (fzf-lib) in the browser

36 minute read

In this post I will describe how to compile a Go library for use in the browser. It assumed that you’re familiar with the previous post in this series, as well have at least a basic understanding of Go, JavaScript and TypeScript.

Making speech bubbles in SVG

5 minute read

Earlier today I wanted to make some speech bubbles for an SVG image I was working on. They’re not hard to make, but getting them right takes a bit of fiddling. So I wrote down some examples, for later reference.

Interface between Go 1.16 (compiled to WebAssembly) and JavaScript (syscall/js)

17 minute read

Last month I posted a story about creating a stand-alone library from Junegunn Choi’s fzf. This was the first step in an effort to produce a version of fzf that runs in the browser. A second step would be to compile fzf-lib to run in the browser. Doing exactly that will be the content of a next post (after which there will be a couple more, looking at performance, looking at whether it’s the smart thing to do, packaging the whole thing into an npm package). In today’s post I will focus on how to make an interface between Go and JavaScript code. There is some documentation out there, but it’s few are far between (and some outdated); hopefully the explanations and examples here will help others (among which future me).

Logging HomeKit data to Google Sheets for free: walkthrough

26 minute read

My home is smart! My home is smart enough to switch off the lights when I’m not there (and then switch them on for a couple of hours each night to avoid break-ins). My home is smart enough to warn me if the front door is left open, or when I should open the window because the level of CO2 is getting too high. However, my home also is very forgetful…

Using KaTeX on github pages

9 minute read

Every now and then I write a blog post with some math in it. Math is hard enough as it is, without the added frustration of having to do a lot of effort (as blog writer) to make it look nice, or a lot of effort (as reader) to decode some math formula written in text, such as Newton’s law of gravity: F = G * (m_1*m_2)/ r^2. Luckily there are tools such as {\KaTeX} that make math look good: F = G \times \frac{m_1 \times m_2}{r^2}. This post explains how to get it working on your github pages (or any html page) through the use of javascript and client-side rendering.

How to embed SVG images on Medium

2 minute read

As you may know, I am a great fan of SVG. I don’t think that SVG gets enough credit on the web, as a small file size, infinite resolution, declarative, next gen image format. A reason why SVG is not so popular, may be that may places that allow image upload, don’t allow SVG; such is the case here at Medium as well. There may be good reasons for this (cross browser compatibility, security, SVGs acting different based on how you embed them). However, in the end, I would love to embed some SVGs in Medium.

Ways to use SVG in your html page

13 minute read

Lately I’ve rekindled my interest in SVG. Using SVG I can declaratively create icons / diagrams / etc, in such a way that both I and the computer can read the sourcecode, and that version control systems, such as github, can easily show me the differences between files. The coverimage for this post was created as a 20 line SVG image (and then converted to PNG since Medium doesn’t support SVG images) — it also shows you that great technology such as SVG is no match for poor design skills. If you have never played with SVG, I can definitely advise you to start!

Better Lambdas with pip packages in CloudFormation

7 minute read

After writing about how to create AWS Lambda Layers based on pip packages, I set out to make writing lambda functions in CloudFormation a bit easier. In the official CloudFormation AWS::Lambda::Function you either must upload your functions as zipfile to S3 and reference them from there, or, if you want them inline, you run into 3 large issues

AWS Custom Resources security “trap” — or why it’s bad to give lambda execute rights to non-admin

9 minute read

AWS CloudFormation allows the use of Custom Resources. These are great if one has to do some things outside AWS (say you create a stack and you want as part of the stack also create a github repository with a bunch of access rights). In practice however I have mostly used them to do things inside AWS that either do not have a CloudFormation interface (yet), or where the CloudFormation interface does not do what I need (for example, build a lambda layer based on pip packages). It takes quite some hassle to set it all up, but once it works, it works like a breeze!

AWS Lambda (python) with packages through pip (in CloudFormation)

4 minute read

I absolutely love CloudFormation as a tool for creating small and large items on AWS. Having code-based infrastructure, of easily maintaining your system in git, seeing differences, etc is pure joy. There are however (many) times when CloudFormation (or AWS in general) seems to miss some things. In such cases, blogs like this one should help you :).

MacPy3D: What is a (manifold) object/body

37 minute read

Generally when making things in 3D, we like to talk about objects. For instance a cube, or a pyramid. When making a 3D modelling library, it therefore pays to have a very good idea of what an object actually is, and what different kinds of objects one can have. Also, it seems that other programs use the term manifold object; I have done my best to explain what that means and what MacPy’s thoughts about this are.

MacPy3D — 3D Model As Code for Python

3 minute read

I’ve always been the kind of person who cannot resist a good challenge, especially in programming. In addition, I’m one who likes to know what is going on, not just one to accept magic, accept bugs, accept that the computer knows better than me.

Timing Morton code on Python on Apple Silicon

11 minute read

Last week I got my new Apple Silicon Macbook Pro M1. I was very excited to do some very simple tests to see how fast python could calculate the Morton Code for a 3D case. I need this for a small project I’m working on, and I found out in a previous iteration that this is taking quite some CPU time. My previous MacBook is a 13” with 2.7GHz Quad Core i7 — the top of the 13” line in 2019; the promises out there suggest that the M1 should be faster. Let’s see.

Cycling in Wrocław, Poland

18 minute read

Being Dutch, I was born on a bicycle. As a youngster, your bike is your only legal faster-than-foot way; later. I started to appreciate the fact that I never had problems parking, and even later I realised that cycling kept me in shape, and gave me lots of environmental karma points. Most of all however, I love the wind in my face, the feeling of freedom, the rest it gives me, whether on a 5 minute shopping trip, or a 12 hours-a-day roadtrip to Berlin or Paris. So whenever I go somewhere, especially for a longer trip, I like to know what my cycling options are, what the rules are (officially, and, more importantly, practically), whether car-drivers are going to be respectful, or will try to kill you. And, obviously, how to find the best roads, those roads that are quiet, but don’t require you to cycle through mud, end up in a field with only option to turn around, etc. In order for others to make this easier, I’m sharing my experiences.

Setup Neovim as Python IDE with virtualenvs

6 minute read

Every now and then you feel overconfident and decide that a full reinstall of your whole system is in order. It always takes way more time than you anticipated, but in the end you’re left with something better (in the computer), and you understand the world a little bit better yourself.