hjertnes.blog

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.

Nock.co A5 Seed

19.01.2019 12:55

This notebook cover have been on top of my list for a while, but when I got into Bullet Journaling at the end of the year, I decided to finally get one. Long story short, this cover will replace my Hightower. The reason I was so exited about is that it makes it a lot easier when I just want to bring my Bullet Journal somewhere and do some stuff. Instead of many it is just one.

The Seed comes in a A6 and A5 version, I got the A5 version to use with my A5 Leuchtturm1917 Bullet Journal. It is a cover, with a zipper, one pocket on the outside where I keep some spare Field Notes and my passport. And on the inside you have two pen loops, and a pocket for anything business card sized. Plus two pockets made to slide your notebook into. I have some of the slim Nock Index Cards, my Lamy 2000 and my Vanishing Point in it.

It is great. I love how easier it is to do some Bullet Journaling with it. There is just a lot less stuff I have to bring or take out of my bag. It’s all there. Two notes, the inner most pen kind of have to be out of it’s pocket to be comfortable to write. And you can’t have a lot of Index Cards when you start to get close to the end of your notebook.

Other than that a awesome notebook.

Syrringe filling

18.01.2019 21:47

I have written about this before, but I’m going to do it again, because I think this is awesome.

If you have a pen that takes cartridges, you are often limited the the kind of ink you can use, unless you get a converter.

A converter is not without problems, because they often have a little bit limited capacity, at least in reality, because you can’t fill it all the way.

One way to solve this, either by re-using ink cartridges or by using a converter is by syrringe filling.

This is how I fill all my non piston pens.

I take out the cartridge or converter, then I just fill it with ink with a syrringe and stick it into the pen.

This means that you can fill it all the way up. It is not messy and super quick.

Getting syrringes from Goulet was the smartest thing I ever did. If you’re unhappy with how much ink you get into your converter you should get one.

Great Switch Games

18.01.2019 21:46

This list contains 5 awesome games to get for your Nintendo Switch, in different categories.

  • Your first game: Super Mario Odessy: not super hard, but freaking awesome.
  • Your second game: Donkey Kong: very hard but a lot of fun.
  • The best: Zelda: I think this is one of the best games Nintendo have made, if not the best.
  • Interesting: Splatoon 2. It is so awesome.
  • Indie: Mounument Valley: this game is so good. A masterpiece by one crazy guy.

Links

17.01.2019 18:29

It’s a little bit weird, but I always think I don’t read much in Instapaper, but when I empty out my likes it always turns out to be a lot more than I thought.

Links

10.01.2019 18:40

I have been thinking a lot about how to share links over the last couple of months. My old style was to add a post for each link. The reason I used to do that was because it started as a Micropub like, and I just kept doing it after I moved away from using Micropub. I have decided that I as a reader would prefer that someone collected them and posted it in one larger post instead of many smaller ones.

The way I consume content online these days is that anything that looks even a little bit interesting are sent to Instapaper, and the stuff I think was interesting or cool are marked as a favourite there. So what I am going to do is that once a week I’ll empty out my likes from Instapaper and share them here.