Hjertnes.blog

My Terminal Setup

February 16, 2018

I have been what one might call a terminal power user for at least 15 years by now.

Here is the thing, from the moment I realised you could start any app from the terminal instead of looking for the application in some list, until now the terminal have been my preferred way to use a computer. There are of course some tasks that works better with a proper GUI app. This doesn’t mean that I use a text based app all the time. It just means that I always start stuff either from a terminal or using a launcher like Alfred on OS X. Instead of clicking in some menu.

I have used three different shells. First I used BASH as my main shell, until I switched to ZSH and I also used FISH for a majority of this year, before I moved back to ZSH. BASH is a very good shell, and it is a huge improvement over the old SH or CMD.exe on Windows. The big advantage with going for ZSH over BASH is mainly about being able to configure more or less anything, including much better support for custom prompts. And much more powerful and polished features in general. I’m of the opinion that all bash users should at least check out ZSH.

FISH is a very modern shell. And I think it will take over from ZSH at some point. I did love using it. But I decided to move back to ZSH for one reason. ZSH plays much nicer with “everything” than what fish does at the moment. The biggest problem with using fish for me, at this moment was that it didn’t work that well in the integrated shells in Emacs and VSCode.

I use a pretty standard Oh-my-zsh setup at the moment. 90% of my config is the default one, with a few aliases and a few variable changes. One of them is to add ~/bin to the path; one of my favourite hacks to have an easy way to add stuff to the path.

My editor of choice at the moment is Spacemacs, and I do more or less everything that involves typing characters into a text field in it. But I also use VIM from time to time. The difference between the two is that Spacemacs is where I sit all day and type, while VIM is what I use when I’m just going in and out fast.

On Mac OS X I use iTerm 2, together with Amethyst and Alfred App. The built in terminal app is fine, but I prefer iTerm because it supports splitting the window both horizontally and vertically. And Hyper is way too slow as far as I’m concerned. Amethyst is just a tiling window manager for OS X that makes it kind of work like XMonad. It’s awesome for weirdoes like me that don’t want to deal with windows.

On my Arch Linux box, I use XMonad, with dmenu and xmobar, and urxvt as my terminal.

#

February 15, 2018

Jesus fucking Christ America. Get rid of that damn arcane futile hillbilly amendment now.

Using a Super Class to share code between components.

February 15, 2018

I often find myself in the situation where I have a lot of components with a lot of the same functionality with different UI. With that I mean that the state is more or less the same, and the methods in the component to deal with that are also the same. But the UI is different.

A thought I had a few months ago, was to do this in a classical Object Oriented way. Where you define all the commonalities in a super class. But I haven’t had the time to test it before today.

Does it work? Yup. It can be an efficient way to limit redundant code in some scenarios.

The basic idea is that you extend from React.Component / PureComponent in one class, and define everything that is shared between your components there. And then you extend from the class you just defined instead of Component / PureComponent all the places where you need to access those methods.

#

February 14, 2018

I installed “Bobby” in my iPhone and realised all the lenses I could buy with the money I spend on subscriptions.

Cancel time.

#

February 14, 2018

[@eli][1](https://micro.blog/eli) Just installed miniflux, does it refresh feeds automatically in the background?

#

February 14, 2018

I closed my Exercise ring seven days in a row and earned this Heart Month award. #AppleWatch #CloseYourRings

React Dev Tools

February 13, 2018

React Developer Tools is a pair of extensions for Chrome and Firefox that makes it much easier to debug when you are developing web apps in React. Most of you probably have it installed, the result of you should install it.

It also makes it easy to see if something are using React, and if the build settings are following the recommended settings for production.

#

February 12, 2018

It’s Micro Monday again. This week I recommend that everyone follow [@patrickrhone][1](https://patrickrhone.net), and buy all of his books while you’re at it. They are all fantastic. All I have to say is that he is one of my all time favourite people.