Put GraphQL fragments in their own files in Gatsby

Gatsby uses GraphQL under the hood for managing data and it does this really well. It usually doesn’t take long before the queries grow big and some duplicated code will occur. This is where fragments come in handy. A way to break out some parts of the queries into… well, fragments, to be able to use it in other places.

Update nvm installed node version and keep globally installed packages

Node Version Manager is great for managing and working with different node versions but can be a little tricky to update to a newer version the first times. Especially if you want to keep all the globally installed packages. It’s actually really simple and here I’ll show you how.

Update Drone CI to latest version

Drone is a great open source CI/CD running in a docker container that is both easy to use and install. Because it runs in a container and doesn’t require a lot of dependencies installed on your system it’s really easy to update to a new version.

Different git config for different projects or clients

If only working on projects with one single git service you won’t have a problem with email addresses differ between accounts. All your commits will always use the same information. But say you are using one service for private projects, such as GitHub, and another service for work related projects, like GitHub Enterprise. If that’s the case you definitely don’t want to use the same configuration for both of them. One solution is to set these manually on every repository but that’s not very smooth in the long run. Fortunately we can set up conditional git configuration per directory.

Always write perfect commit messages with Git Commitizen and Husky

We’ve all been there, looking at a function and don’t understand a thing of what it does. The next step is of course look at the commit message, the git blame. That will explain everything for us. Or will it?

Make a TypeScript Node server hot reload on changes with Nodemon

When building a front-end app today it is common to have the app hot reloading in the browser every time you make a change. This can also be done for your back-end app built with Node by using a package called Nodemon. This app watches all your files for changes and, if it finds any, reloads the server. Nodemon is simple to use but needs some more configuration when you use TypeScript.

How to install and configure Drone CI on a self-hosted server

Drone CI is an open source continues integration and delivery platform built on container technlogoy. It is a lightweight and easy to use solution for testing and deploying your projects. Drone is distributed and run in a Docker container meaning it has no install dependencies at all (well, except for Docker itself) and it’s very easy to set up and configure. In this guide we will install and configure Drone on a self-hosted server and then set up GitHub repositories to automatically test and build our projects.

Keeping a forked repository up to date with the original repository

If you fork an existing git repository and add that fork to your own repositories it will not be in sync automatically with the original repo. That could of course be a good thing if you want to develop the project in your own direction without anyone “ruining” it for you. But sometimes you want the best from both worlds, have your own repo but also get all the updates of the original source. This can be achieved by setting an upstream remote.

Working with multiple git services simultaneously

If you have your git repositories spread across multiple git services, like GitHub for work and GitLab for personal, you can run into problems with your git credentials. Especially if you are using different email addresses, such as the privacy addresses provided by the services. The solution is simple and doesn’t require many lines in the terminal.

Keyboard build - va69m with Zealios switches

I’ve always loved Varmilos keyboards and their amazing build quality. Unfortunately the firmware is often really bad and leave a lot to wish for, especially the lack of programmability. As with most mass produced keyboards the selection of switches are also quite slim. As for me who like tactile switches the choice is often only between brown and clear switches. The solution is easy, a custom build with a Varmilo case but with better switches and support for programming.