06. December 2020
4 min

Advent Calendar: How to work (online) fast

Second Door of the blog advent calendar. This time you will learn how to spend more time with your family and less time with working.

This is the second blog post of the advent calendar series. Read the first about containers and build tooling with maeddes here.

Today is Nicholas day, and I thinks we all want to spent some time with our close ones (as good as this is possible). So logically, this week is about efficiency and productivity, so we don’t spent so much time working on things that will hold us back.

IDE Features and Key Promoter X

I use IntelliJ for most of my development work. I’m simply used to the Interface and all the key combinations in IntelliJ. But what if you just start with development. Remembering all the key combinations that do specific tasks is hard. The IntelliJ Plugin Key Promoter X helped me with this task. It shows a small Notification box, when you click on something that you could have done with any keyboard shortcut. Especially for starters with IntelliJ, this can really help (recommended to me by Marc Häbich).

For a lot of non JVM Language work, like Python or JavaScript, I use Visual Studio Code. And there I have the same problem as with IntelliJ, remembering all the keyboard shortcuts. For this, I printed out the provided cheatsheet. Still, the most used key combination i press in Visual Studio Code gotta be Ctrl Shift P, which opens the command pallet and allows to type in any command you can search for.

jq and yq

Quite possible, everyone has heard of jq. If not, install it and use it. It allows for JSON query and manipulation in the shell in a way, that is by far easier then using awk, sed or something similar.

But have you heard about yq? I sure hope so, but if not, and you work with any form of YAML, have a look at it. yq allows for the most convenient batch operation on YAML files i can imagine. Its, as the name suggest a jq clone for yaml. I use yq in combination with jq all the time in our CICD pipelines as well as when editing our concourse pipeline files, especially for batch operations.

tmux

I guess everyone knows about this problem. You have a permanent running process started from the shell, which you might not want to detach, But you need a second shell, or maybe even a third, forth, … . I at least have those problems when trying to get logs from my Kubernetes applications. At first I always opened a new shell window and had to search for all the open tabs. As it is with such thing, I quickly lost the orientation. To fix this, I now use tmux. Tmux allows to create multiple terminal sessions with some key combinations. What make tmux great (at least for my use cases) is the configuration file. You can basically make tmux your own. The second big feature is the status bar. It is also configurable and allows for highly customizable displays. I use it to keep track of my current Kubernetes context to know, on which cluster and in which namespace I currently work. The biggest disadvantage is the “steep learning curve”(at least for my taste). Once you start working with it, I simply could not stop tweaking small details. As the saying goes: “A Software Engineer is someone, who spends 2 hours automating something, that he could have done in 20 minutes manual work”.

httpie

I dont like curl. Yes I know, burn me on a stake. I use curl from time to time, and I can never remember any commands, flags or anything. I always get the formatting wrong and basically I sit there an always ask for my favorite HTTP Client, httpie. Httpie is a human readable, understandable and (at least in my opinion) modern replacement for curl, which especially works well when developing APIs. Ofcourse, most of us already have a Postman collection that is used in the project, but from time to time, I find myself in a shell session I don’t want to or can’t leave and then, httpie is my way to go.

bat

Last but not least, the same way I don’t like curl that much, i don’t like cat when printing out files. Of course, when piping the output into other scripts, cat is unbeaten, but when I want to read a file, printing everything out on the command line usually does not help me with readability. To quickly scan through files on the shell, I recommend bat. bat has a lot of features I really like, which make working with it easier then with cat. The most obvious one is the syntax highlighting. For me, the automatic pagination is also quite important, as I usually only have limited screen space in my shell, and when I need more details, I usually open the file in VS Code. But for quick looks into source code, I basically never touch cat and always use bat.

Final remarks

As always, this is not a perfect list and are just some tools I use or was recommended by colleagues. If you have more such tools I would be happy to hear about them.

Have a nice Nicholas day and second advent sunday. I hope to see you next week, when we will write about something everybody is writing about, remote work.

Comment article