Categories     Timeline     RSS


I’m wondering whether what we call meditation nowadays isn’t just cargo culting for actual meditation, i.e. subliminal tasks that clear your head. Be it physical exercise, manual labour, hunting, fishing, staring into the fire, organising your stamp collection, cooking, baking, sewing, weaving, knitting, pottery, painting, the whole zen monk sweeping thing. How is sitting on an mat, listening to music and burning incense supposed to accomplish that?

Annual reflections

Past the age of thirty, year-end has become a time for introspection and self-reflection to me. This year I want to give special thanks to my neighbour, who tried to make my life hell, failed miserably and accidentally made me grow by leaps and bounds. Get well soon :-)

Minimal three tier Golang app

with TypeScript frontend, REST, a .txt as “data store”, no external dependencies, all compiling to a single binary. The overwhelming result:

It alive

But it represents a starting point for a three tier application. Any real world example would use an actual database and maybe a better routing scheme. You need Go, tsc (npm install -g typescript), Make and a browser. Compile and start with make, then open http://localhost:8000 and hit the button.

$ cat Makefile
all: hello.js hello

hello.js: hello.ts
        which tsc || sudo npm install -g typescript
        tsc hello.ts

        go run hello.go

$ cat hello.ts
interface Answer {
    Current: Number

async function getCurrent() {
    let answer = await fetch("/current")
      .then(res => res.json())
      .then(res => res as Answer);
    let counter = document.getElementById('current');
    if (counter != null)
      counter.innerText = answer.Current.toString();

$ cat go.mod
module hello

go 1.16

$ cat hello.go
package main

import (
	_ "embed"

//go:embed hello.js
var js string

var html string = `
<script>` + js + `
<h1 id="current"></h1>
<button onclick="getCurrent()">Load Current</button>

const storefile = "myfancydatastore.txt"

type Answer struct {
	Current int

func readFromStore() Answer {
	b, err := ioutil.ReadFile(storefile)
	if err != nil {
		// do something
	var a Answer
	err = json.Unmarshal(b, &a)
	if err != nil {
		// do something
	return a

func writeToStore(a Answer) {
	b, err := json.Marshal(a)
	if err != nil {
		// do something
	ioutil.WriteFile(storefile, b, 0644)

func serveIndex(w http.ResponseWriter, r *http.Request) {
	if r.Method == http.MethodGet {
		w.Header().Set("content-type", "text/html; charset=utf-8")

func handler(w http.ResponseWriter, r *http.Request) {
	if r.Method == http.MethodGet {
		w.Header().Set("content-type", "application/json")
		a := readFromStore()
		b, err := json.Marshal(a)
		if err != nil {
			// do something
		a.Current = a.Current + 1

func main() {
	writeToStore(Answer{Current: 0})
	mux := http.NewServeMux()
	mux.HandleFunc("/", serveIndex)
	mux.HandleFunc("/current", handler)
	fmt.Println("Starting server on localhost:8000")
	http.ListenAndServe("localhost:8000", mux)

Watch hedgedoc notes

I pushed hedgedoc-watcher to, which allows watching hedgedoc notes with an RSS reader.


I pushed a snippet to, that will download a hedgedoc note with hedgedoc-cli and commit it to a git repo. I use it in connection with a cronjob to periodically save my todo lists.

< Older

Newer >