Leben++

It's never too late to get a life

Notes for Advent of Code 2019

2019 was the first year I have participated in the Advent of Code challenges, encouraged by my colleague Jan. I wanted to make it an opportunity to learn new programming languages and focus on functional programming. I started with Racket, tried out Elixir and re-wrote the challenges that involved the “intcode computer” in Scala. This post is a review of the programming languages and the event itself.

What I learned from different JavaScript implementations of Conway's Game of Life

I participated in the Global Day of Coderetreat, practicing on the Game of Life Kata and heard that some people solved the problem of finding neighboring cells with a Cartesian Product. I did not see their solution, but tried out figure out my own solution. I learned something about JavaScript, functional programming and performance, which I will share in this article.

Check out your GitHub pull request with an interactive shell menu

When I want to check out a GitHub pull request of my colleagues on my local machine, I usually have to open my browser, go to the pull request page on GitHub, copy the branch name, do a git fetch in my terminal, followed by a git checkout, pasting the branch name. Annoyed by this context switch between terminal and browser and all that mouse movement, I devised a way to select the pull request from a list in the terminal, with a checkout when I hit Enter:

Guarding Your Value Objects

When you apply the principle of Domain Driven Design (DDD) to your code, you start to notice all the small “rules” of the domain. Rules like “A name must not consist of whitespace, must have its whitespace trimmed on both ends and cannot be empty." Or “A donation amount must be greater than zero." Or “A book must have at least one page." It’s important that you can’t create value objects that violate those rules.

Using Ansible to call REST APIs

In the Fundraising Team of Wikimedia Germany we maintain our own infrastructure, using the principle of Infrastructure as Code: We write every configuration change, every installed package, every other server setup tweak as a text file that we check into our version control system and do a peer-review on. This way, we can replicate our setups, share knowledge and track changes and their context. While setting up a Graylog instance we discovered that its configuration file does not contain all the information.