hjertnes.blog

Mophie XXL

09.02.2019 16:07

I’ve been a huge fan of powerbanks for years. They kind of changed how I think about using battery powered devices. Suddenly you’re not limited to the built in battery or having to sit next to the power outlet while it charges.

I ordered a new powerbank in the beginning of December. It is made by Mophie, it’s just called XXL. The main feature of it is that it is a real USB-C powerbank. You can charge it with your MacBook Pro USB-C power brick and it will take advantage of the power of it. And you can also charge anything USB-C, like the Swithc or even a MacBook.

It also comes with a A style port.

What I love about this thing is that it charges from empty to full way faster than anyhting I have owned. And it can charge anything USB I own. It have made by travel powerbrick situation a lot simpler.

Links

08.02.2019 21:18

It is amazing how many links I actually read each week, and consider interesting.

Gitkraken

03.02.2019 13:49

I’ve been very skeptical about this app, for a really long time. I never got what the fuzz was about. It is a electron, subscription, freemium app. Talking about hitting all the hate points out there. But it is awesome.

It is a fantatic Git App, but it is not the best App in the world. It is very cross platform.

If you have used a git app for any amount of time, there are probably some stuff annoy yu a little bit. Like dealing with merge conflicts managing branches or even doing simple editing while committing. What Gitkraken seems to be doing is to make things a little bit better all places there are some friction.

Merge conflicts? You get a simple interface with checkboxes. Simple edits? It has a very basic text editor. Changing branches, upstreams and al of that junks are at most two clicks away. I have used it for a couple of months by this point, and I really like it. Not because it is a great app, it isn’t, but because it removes a lot of friction.

Retiring the Hightower

03.02.2019 13:42

The Hightower is one of the best purchases I have ever done. I first got in 2014, not as a part of the Kickstarter that started Nock.co, but as soon after it that it was in stock and I had money to buy it. It have been a part of my daily carry since then. I have had 2-3 pens and 2-3 fresh Field Notes in it since then.

It shows no signs of wear, and it looks like it was when I got it, except for some ink spills. This and all the other Nock.co products that I own seems to be made in a way where they will last forever.

If you look for a great case to carry a few pens and a few Field Notes sized notebook it is the best thing out there.

Links

02.02.2019 19:02

Blackwing Pearl

27.01.2019 17:55

I was buying some other stuff, and ended up also getting a box of Pearl. Mainly because it is the one type of blackwings I have not tried.

This is probably my favourite of the regular blackwings from a design perspective. It looks fantastic. A white finish with gold text.

The core is in the middle between the MMX and 602. It is usable for writing, but not very.

Unlike the MMX, the Pearl feels like something that you could actually write with without having to spend more time sharpening than writing. But still not something I would write a lot with. I still recommend gettign the 602 for general writing, or one of the limited models with the extra firm if you can find them.

Write code with tests in mind

27.01.2019 17:50

You can write code in many different ways, some of them are more testable than other, even though many of the less testable ways are not bad or anyting like that. Like mutating a reference value like when something takes a output pointer etc. Or having most of the code in the controller.

None of these are “bad”. But it makes it harder to write unit tests for it.

If you think something is good, then try to make it as easy as possible to do it.

I don’t do test driven development, because I don’t think it is the best way to work. But I do think that writing unit and integration tests should be a part of the process, because having good tests and coeverage will save you time in the long run. And it is a must if you want to move to the next level and get into automated deployments.

If you start with a typical C# .NET Core REST API. Then you could do everything in the Controller. It would work well. And the code could be clean. Probably a little or a lot of duplication of code but still it could work.

The problem with this approach however is that there is nothing you can unit test, because everything is tied together. Then you are limited to integration tests.

What I usually do is that I take the Controller and I limit it to validating input, checking permissions (ideally done with attributes and filters) and calling a “service”.

The services takes input from the controller and is in charge of checking all the right things, doing all the correct operations and preparing the data structure the API should return.

Then all SQL stuff, and all the Redis stuff etc are put into repositories. And the classes that takes data and turn into something else are done in builder classes.

All of this are tied together with as many static methods as possible (where it is possible) and dependency injection.

The advantage of this approach is that you can actually write tests for the controller without it showing up in the database. And the same goes for the service and the builders. Because you can just fake the dependency injection crap.

If you want to have a project where most of the code is covered by tests, then you need to write the code in a way where it is possible.

Link dump

26.01.2019 13:30

New site

19.01.2019 13:02

The Zelda Book

19.01.2019 13:02

Zelda Breath of the Wild is a nuts game. It was the first game I got for my Switch, and it is one of those games I obsess about in certain periods.

It is a really hard game, and a big game. The thing about Zelda is that it is a game where you, after the first part, can do shit in more or less what ever order you want. This means that a lot of it is to figure out stuff to do.

It is not like Pokemon where you have a order, and a lot of side stuff. In Zelda there are some orders you have to do stuff, but there are also a lot of variations to the order you can do the different things.

In order to make stuff a little bit easier on myself I got this huge ass coffee table book on Zelda.

If you’re into Zelda, I’d get it. Both because it is cool, and because it makes the game easier and less confusing.