RSSAmplifier

Blog

Bart Fokker

Bart Fokker personal website

bartfokker.comRSS feed ↗8 posts

Latest posts

Multi command fzf history

TL;DR I improved the default fzf history widget to allow multiple commands and stitch them together using && I am a very heavy terminal user who likes to optimise his workflow in the shell using various command line tools. With the restriction that I always try to stay as close to the original feeling of the shell as possible. I prefer the Unix way, combining multiple (single-focused) tools…

How to organize your code base

Introduction Besides scaling the application itself for user demand there is another very important aspect to scaling which is organizing the source code itself. We've all heard (or seen) the horror stories about very big unmaintainable code bases. In this post I will elaborate on what I think is a good practice on maintaining your source code as the project grows. The why Over the (short) period…

Running a serverless Go web application

Introduction Recently Google introduced the beta program for Google Cloud Run . This is a service to run stateless containers on a fully managed environment by Google. It is essentially serverless for any container, scaling your containers up and down as requests (and peaks) come and go. The benefit of using tools like Cloud Run is that it abstracts away all the infrastructure, thus you can focus…

Mocking system time in tests

Introduction Recently I was working on my personal project and I encountered a situation where I was calling time.Now() to get the current system time. I was working on a function to calculate someone's age from a birthday, I needed this function to display it in my app. I did not want another field in my database with someone's age, since in my opinion this calculation from the birthday is pretty…

Clean code using decorators

Introduction In this blogpost I'm going to explain how to keep your code clean using decorators. By applying decorators the open close principle is maintained, code becomes easier to extend and easier to adjust. Background According to wikipedia the decorator pattern is a design pattern that allows behaviour to be added to an individual object, without affecting the behavior of other objects from…

Clean http handlers in Go!

Introduction For this blog post we are going to take a look at the http.HandlerFunc type and how we can improve it to make more elegant and clean handlers. Following the idioms of Go and staying compatible with the standard library. Handlers In Go A Handler is a type which responds to an HTTP request. type Handler interface { ServeHTTP ( http . ResponseWriter , * http . Request ) } Any struct…

Build your own ASCII github issue table in Go!

Introduction In this blogpost I'm going to show you how you can create your own github issue table for inside your terminal. We will be covering some cool features and the implementation. Code can be found here: Github repo The looks of the application Programming What we want to achieve with the application is that we can specify a github repository url somehow and display x amount of issues in a…

Tutorial: Identicon generator in Go

Introduction In this tutorial we are going to build a simple identicon generator in Go. The source code can be found here: Github repo . But what exactly is an Identicon? I think most of you are familiar with the standard logo you get when creating a new account on Github. Example: What you see here is a visual representation of a hash value. What this basically means is that a input is hashed…