If you haven’t tried feature toggles, they may seem daunting and/or abstract at first. But they can be implemented in a very simple way and will provide you with a powerful mechanism to change your code. Once you get to know feature toggles, you won’t ever want to write code without it anymore. And once you’ve implemented it yourself a few times, you’ll want to look at elaborate solutions. Simplifying things more than a bit, feature toggles allow you to

If you use GitHub, Bitbucket or VSTS regularly, you will be familiar with the term pull request. I believe GitLab uses the term merge request, but that it’s essentially the same thing (but don’t quote me on that). What you do is create some changes, and request another contributor to merge those changes into (usually) the main branch. The idea is to have a place where you can see the changes and have meaningful discussions about it. The pull request

Let me set the stage for this post first. Peergroups.be, the sharing economy website I develop for the non-profit WijDelen, is based on ASP.NET MVC. So I have a bunch of Controller classes with methods that end with return View(model);. Our first goal was to have a web application running as quickly as possible. Now that we have a stable system with active users, we’re looking into writing a mobile app. The mobile app can have the same pages/screens as

Here’s something I always need to Google: how to pivot the results of a query in T-SQL. In the Peergroups application, we help people lend objects from their peers. So, simplified, we have a Request table that includes the following example data: Id Description UserId CreatedDateTime 1 A lawn mower 54 2018-01-21 2 A ladder 12 2018-01-24 Other people in Peergroups will receive a message from these users, to which they can reply whether or not they have that object.

I recently had to generate a JSON Web Token (JWT) as a response from an login request to an api. The idea is to POST the user’s credentials from a mobile app, and to respond with a JWT. The mobile app can then verify that the user has logged in correctly. A quick introduction to JWT But let’s step out for a moment. What is a JWT exactly? According to jwt.io, a JSON Web Token is an open, industry standard

Another year has past, and as always, I’ll do a quick overview of what happened. I’ll also look at what will happen, making silly predictions and statements about what I will do in the next year. Predictions and statements that usually don’t come to fruition, because, well things happen and interests change. 2017 Peergroups 2017 was the year I helped launch Peergroups, a sister-project to Peerby. Both are part of the sharing economy. They allow you to make a request

If you’re reading this, you may have noticed that you’re currently on petermorlion.com, the address of my blog. It’s a custom domain, served over SSL. Behind the scenes, I’m running the Ghost blogging software on Azure, with Cloudflare in front of it all. I recently had to set this all up again (due to updating Ghost), so I thought I might document the necessary steps. Setting up Ghost on Azure Setting up Ghost on Azure is quite simple. Ghost doesn’t

I always try to convince other developers that writing your test first is not just about doing TDD the “correct” way (if there even is such a thing). That sounds a little fundamentalist. Rather, it’s about making sure your test is failing and failing for the right reason. Actually, this is only one reason, as writing your test first also pushes you more towards writing only the code you need, writing tests that cover all code paths, and forcing you

This article was written for a friend, who works in a company where developers are local admin on their PC’s, but don’t have access to the registry. I’m not sure if this is a Windows thing, or some custom solution of that company, but needless to say, developers weren’t happy with the situation. This article attempts to find some middle ground, but also explain, for non-technical people, why developers need access to the registry. Why do developers need access to

When writing tests, you can often end up with tests that have (almost) the same setup. Certain input variables may change, but the structure of the setup code remains the same. When the setup is small, you can copy from one test to another. But when there is more ceremony involved, you will start to feel the need to avoid duplication. It’s a best practice to apply coding principles to both your production code and your test code. Don’t repeat