Find and Replace in multiple files

As a software programmer you often have to search and replace a specific string in multiple files because of a refactoring or just improving a variable or function name. Normally you can use your IDE or your editor for this. But in bigger codebases with thousand or million lines of code it can be very slow. Neither do IDEs work with remote SSH-sessions. In such situations the command-line is pretty handy....

April 13, 2019 · 1 min · Daniel Gerlach

ag the_silver_searcher, a grep replacement

As a programmer you often search for a specific strings or regexps in multiple files. Previously i used to do this with the well-known GNU-tools find and grep. The following command searches for main in all *.go files in the current directory and: 1 2 find . -iname '*.go' | xargs grep -inH "main" # -i ignore case, -n print line number, -H print filename Recently i discovered ag the silver searcher....

April 13, 2019 · 1 min · Daniel Gerlach

Emacs Test Regexps

Replacing or searching text with regular expressions is very common. But sometimes it is hard to get them right and you need some playground to try them out. In order to verify regular expressions i used to visit webpages like: https://regexr.com/ https://regex101.com/ But these webpages are optimised for perl, javascript or bash expressions and do not support Emacs regular expressions directly. In Emacs you have to consider some peculiarities....

April 6, 2019 · 1 min · Daniel Gerlach

Things to consider with microservices

Introduction Some years ago i was involved in migrating a big IBM Websphere monolith into a microservice landscape. We had a lot of problems with the monolith. Our development speed slowed down. We had many merge conflicts because of too many dependencies in the codebase. We outgrew the monolithic design and decided to introduce microservices. We extracted different domains like payment, booking, user and search. The teams were restructured into two-pizza teams....

March 30, 2019 · 7 min · Daniel Gerlach

My Presentations

Links to my presentation slides clojure introduction javascript introduction java8 new features hashicorp nomad tutorial

March 16, 2019 · 1 min · Daniel Gerlach

My Nickname Is Danger

A few years ago one of my colleagues “discovered” an algorithm which led to my nickname: take the 3 first characters of my first name and surname concatenate them: DANiel + GERlach => Danger The algorithm can be implemented as a pure function in Javascript: 1 2 3 4 5 6 7 8 9 function getNickname(fullname) { return fullname .split(/\s+/) .map(n => n.substring(0,3)) ....

March 15, 2019 · 1 min · Daniel Gerlach