hjertnes.blog

Pass: Im going back to 1Password

24.04.2018 02:00

I thought Pass looked interesting. So I decided to give it a shot. And it is a interesting idea. But I have decided to go back to 1Password because it is better. The user experience is much better, and pass felt too much like work. And the browser extensions was not reliable enough for me.

#

23.04.2018 02:00

My girlfriend isn’t happy when I compare the local dialect to the swedish chef

#

23.04.2018 02:00

The Field Notes pencil is actually good.

Project configuration.

23.04.2018 02:00

If you are working on a software project that have a backend or server component, it probably have some kind of configuration. Like database servers, maybe some API keys to upload to S3 etc. To get configurations right, the first time is always a pain in the ass. Because some of it is about configuring exciting tools and libraries to work with your setup, and other times it is about configuring your stuff depending on where you want to run it.

There are a few different ways you typically would deal with this. And there are a few ways I would encourage you to not do.

The biggest don’t is to not put it in a database, because you might want to take data from production and use it during development to make sure that what you make scales well. Make sure that you don’t keep settings that only works in production in the database. Because it will make stuff like testing production data much harder than it has to. And don’t just hard code settings.

The day I usually do it, is to hardcode the development settings in my projects. And then I re-configure them to run in production. Why? The less time I have to configure the machines of the people I work with, the better it is. When it comes down to the actual configuration I think there are two good ways to do it in 2018. Either with a configuration file or with environment variables. There are places where using a configuration file makes sense, and there are places where using environment variables are better. A configuration file is awesome for all kinds of settings that applies to your software project, as long as they always are the same. The moment where it might change is when you run into trouble. Because it is a pain in the ass to keep multiple almost identical files up to date. A typical software project runs in three different environment: development, staging and production. Development is a developers personal machine, staging is where you test stuff to make sure everything works in a production like environment and production is where your users or customers will use it. The way I do it these days is that everything that is not the same all places are controlled with a environment variable. Usually through a docker-compose configuration file.

What are a environment variable? Well, they are like a variable in your programming language, except that they belong to the environment the program runs in. This means that if you have two programs on written in Java and one in Python that uses the same database, they can read the same connection string.

Let’s say you have a project with two variables that change depending on where you run it: URL and DATABASE_CONNECTION_STRING. The URL is used to display the full URL to a resource for when you need it(for example when sending an e-mail) and the DATABASE_CONNECTION_STRING is used to connect to your database. I use environment variables for this because I can just change them in the script or server configuration. Instead of having to keep multiple copies of large config files on the project side of it. That someone (me) have to keep in sync. On a UNIX/Linux system you could just do something like URL=”https://yourdomain.ltd“ DATABASE_CONNECTION_STRING=“‘postgres://pompeii:pompeii@db:5432/pompeii” command-to-start-your-server to override them.

If you for some reason need to implement some project configuration on your own. Use JSON or YAML. Most if not all developers know the formats, and you’ll find parsers for all languages under the sun. And some in the shadows as well.

To keep or not to keep?

23.04.2018 02:00

I guess this comes as a response to recent discussions on The Pen Addict podcast about keeping journals or not. My collection of notebooks is growing. And it grows some every year. The big question is: what should I do about them?

One option is to just keep them and let future generations deal with it. Not unlike how my parents and grand parents generations dealt with climate change.

Another option is to throw it all out.

And the third is to throw out some of it.

A lot of it is just notebook after notebook after notebook of tasks. While other parts are notes I have taken while reading or studying. And some of it is journaling.

Here is the thing: I’m probably the worst judge to what’s interesting. And I’m not one of those who care what happens after I’m dead and buried.

#

21.04.2018 02:00

It’s cool that SmugMug have bought Flickr. Flicker was awesome, but I stopped using it because the Yahoo authentication crap drove me nuts. Let’s hope they don’t fuck it up.

ES6 Proxies

20.04.2018 02:00

ES6 Proxies are awesome. I have not used them much “in the wild” yet. But I think they add some very interesting concepts to JavaScript. You are kind of familiar with them if you have worked with Properties in C#, Java, Swift or Objective-C. The short version is that you define a method that is called when you try to retrieve a value or setting a value. But instead of calling .methodToGetMyValue is it called when you try to access some value.

The biggest difference between the JavaScript Proxies and setter / getters is that you define them for a “variable”(in lack of a better word for it). That means that you could define it for an entire list or object or just a value.

#

19.04.2018 02:00

Portacle. Pretty cool, but it’s just Emacs with some fancy wrapping.

#

19.04.2018 02:00

Are there any good, fast, native OS X Slack clients with support for multiple teams?

How I use my Fujifilm x100.

19.04.2018 02:00

I got my X100T when I was a Canon shooter. And then a year later it died, and I replaced it with a X-Pro 2. The result was that I did not use the X100 that much. Mainly because I prefer the X-Pro in more or less every way.

Then I started to use the X100 again. I just leave it in the office, with batteries and a 16GB card. To take snapshots. For, you know all the times you want to take a picture, but the big camera is somewhere else.