hjertnes.blog

Pull request based workflows

12.05.2019 10:53

There are two major ways to work with git that I am aware of, you either work directly on a branch, that means that everyone commits to the main branch (usually master) and then pushes changes directly to it. Or you work on “feature” branches, create a pull request for it, and someone reviews it and then you merge that into master.

I think Pull Requests are useful even for very small teams because it is a very simple way to do code reviews. That makes it easy to point out dumb mistakes we all make, give good tips or point out things we didn’t think about. Or to give your team mates grief for not writing tests.

Personally am I also a huge fan of deploying a PR, then merge it into master, so that the pull request are deployed all the way to production. It is the best way I know of to keep enviornments stable.

Some CMS changes

11.05.2019 13:24

I’ve been working a little bit on changing how I manage my sites recently. The Inksmudge is still on Hexo but I’ll move it over to Gatsby soon. And I have created a wiki using the same setup.

I have configured Gatsby to work with a folder structure of front matter markdown files like Hexo, Hugo or Jekyll does. And it just generates a folder of HTML. I host and build it with Netlify. But I write it all using org-mode, through ox-hugo. I just have a few org files that I geneerate markdown files from.

I’m really happy with this setup because it makes it just a little bit easier because I don’t have to create a lot of files etc. Probably not something most people want. But it works great for me. One thing to note though, I do keep blog posts in multiple files for this site, because a single org file doesn’t scale beyond a few hundred. Than it all becomes kind of slow, and it takes a long time to generate

Likes

11.05.2019 13:04

Yoga

09.05.2019 21:08

One of my goals for 2019 is to loose some weight and get into shape. The main thing though is to get something started that will make sure I’ll be healthy in the long run. In other words: I do not care that much how much I loose this month, next month or this year even. But rather that it is more of a lifestyle change.

I have been into different kinds of excerise in the past, running, going to a gym, rowing machines, swimming but none of it really worked for me. I’m not sure why. So I decided to see if I could find something different this time. What I landed on was Yoga, because it didn’t require any equiptment or a proper gym. The latter is important because I do not have a huge amount of time for this, and the less time I have to spend getting from and to excerise the better it is. Also: if I can do it inside it is a huge bonus, because then I can’t use the shitty weather as an excuse.

This is something I started in the end of January, and I’m still doing it. What I really enjoy about doing yoga is that it doesn’t feel like I’m really working out, something that is great when you don’t really enjoy most kinds of excerise, and you notice the difference in both strenght and flexibility more or less straight away. I have way less problems with stiff muscles and pain in my back, shoulders etc after I started doing this.

The way I got started was that I searched for Yoga in the app store downloaded the first 30 apps or so. Deleted all the worst ones and continued doing that until I had a small handful of usable ones. None of them are great, but some are usable. The first few weeks I used one called Daily Yoga. It is pretty good, you have you video based guided yoga. It was really helpful in the beginning. But then I felt like I wanted something different, more like “I want to do yoga for 15 minutes tell me what to do”. The only good app I found for doing that is called Pocket Yoga. It is pretty awesome. There are five different options and some options to configuring how long etc. It is great if you want something guided. They also have an companion app for desgining your own sequences.

My feeling is that Yoga is very much about finding what works for you. What I do these days is that I just track it with my Apple Watch and do it unguided. And I use an app called Yoga Studio to look at poses, and I try to remember at least one new one each week.

I also bought some books, they have give me a lot more than any of the apps have. This one is my favourite: Namaslay: Rock Your Yoga Practice. It is fun and awesome.

There are a lot of yoga gear available. I didn’t use any when I started out, and I didn’t really have any until very recently. It is helpful but not neccessary. I bought a starter pack of a mat, two blocks and a strap. It helps, but it is in no may neccessary to buy any before you know if you like it.

Why rolling your own emacs?

05.05.2019 19:28

This might not be for you, but if you’re into being able to configure and make your own text editing environment it might be for you.

Then you have the option of using a starter pack like Doom or building your own. I used to love Spacemacs and Doom until I started to become frustrated by the complexity under the simple configuration system, and the limits of it.

The result was a six month period where I experimented with all kinds of starter packs, my own configuration multiple times before I finally learned enough and found a setup that worked for me.

I do recommend doing your own config and I do recommend learning the default keybindings. But when you do start with no packages except use-package and add stuff as you see a need. And learn to add them using use-package from day one.

On no packages, the fewer packages you add the faster and more stable emacs will be. And emacs makes a lot more sense if you use the default keybindings.

My configuration are used on windows, Mac and Linux. This makes it more complex but only very few configuration items are affected by this. But it makes it more complex.

The way I deal with my configuration is that I have a very low bar for adding new stuff to my configuration, but I also regularly remove everything that doesn’t add real value.

Emacs is a lot less fancy than something like vscode, but also a lot more powerful.

Ystudio portable brassing

05.05.2019 19:23

I recently got a new pen. A YStudio Portable fountainpen; medium nib, the black one of course.

It is a brass pen, that use a standard cartridge and a standard nib. It comes with a converter, so you can just ink it up with your favourite ink. And a lot of companies like Franklin Chrisoph make nibs that fit it. I have not done that yet, but I might in the future. But I like the standard steel nib in it.

It looks really cool, and I bet it will look even coole ras some of the finish starts to wear off. It feels like unboxing an Apple product when you take the cap off, a lot resistance in the good way. And it comes with this leather string you can thread through a whole in the cap.

I think it is a great pen to have in your pocket. It is not a large pen, but not that small either, and the string is really useful when using it on the go, because you can just let the cap dangle from your thumb while writing.

Also it is heavy enough for you to never wonder where the hell it went.

A great pen, and I wonder why I havent gotten it before.

My pile of Instapaper automation hacks

03.05.2019 20:35

I try to automate stuff in my life to remove friction. One of these areas are sharing cool or interesting links I’ve read. The way I do this is that I mark them with a heart in Instapaper, then I copy the links out and post it before I remove the heart and start over. This would be a really simple task to automate through their API, if they’d bother to answer my request for an token.

The result is that I wrote this script. It is on NPM and you can run it with something like npx @hjertnes/likes ./pathToFile.csv. The way it works is that you download a CSV export from Instapaper, point the script at the file and it puts the links as a list of markdown links on your pasteboard. Then I paste it into a markdown file and publish it.

Then I paste this Object.values($(".action_link.star_toggle.starred")).map(x => $.get(x.href).then(y => {})) piece of Javascript in the console in the browser with the Likes section of the Instapaper website open, then I refresh and repeat until it’s empty.

That’s it. All of it would be a hell of a lot faster, cleaner if I got access to a proper API.

Likes

03.05.2019 20:17

KUM Masterpiece vs Classroom firendly

28.04.2019 20:07

The KUM Masterpiece (or the KUM longpoint sharpener, it is basically the same thing) and The Classroom Friendly are my two favourite pencil sharpeners. The former is a inexpensive, small sharpener while the latter is more expensive and not very portable. Both of them give you a great long point.

I use the Classroom friendly most of the time because it is a lot faster. But I also use it because I prefer the point it gives me. It is not as sharp as the KUM’s give you. Some people might think that is a bad thing. But I don’t, because sharpness is only a good thing if it is actually usable. And I think that the super sharp point the KUM gives me break too easy and sometimes tear the page.

Write a notefor yourself at the end of the day

28.04.2019 20:02

When I left the startup I was working for and started to have a normal relationship to work, and leave it at the office I started to have a problem with remembering where I left off when I got back to the office.

For a while I continued not doing anything about it, but then it started to become ridicolus spending like 15 minutes trying to figure out what I should be doing. So I added a Due reminder monday to friday to write a note for myself 20 minutes before I leave. Just a few lines to describe what I was doing and what I should get started on next.

It sounds kind of dumb, but have worked great.