Skip to content

Coding Practice

NDC Oslo 2019: Inspiring & Practical

NDC Oslo keeps growing. This year you could choose from 19 pre-conference workshops and attend one of 10 parallel tracks throughout the 3 days of the conference. The mix of well-established speakers and newcomers was very interesting and nearly 2500 attendees found their way to the Oslo Spektrum.

My biggest challenge this year was to choose a session. Too often I wanted to attend 2, 3 or even 4 talks in the same time-slot. Luckily, the talks are all recorded and I can watch them soon. The agenda was very much in line with what my company wants to adopt in the near future. I will therefore have plenty of chances to put my newly gained knowledge into practice.

How to Use Docker & Visual Studio for Your ASP.NET Applications on the .Net Framework

Visual Studio 2019 offers some great help to use Docker with ASP.Net applications on the .Net full framework. The support for Docker improved over the last versions of Visual Studio and is now on a level where you nearly can't get it wrong. If all is working, you can start your application inside a Docker container with the click of a button:

Visual Studio run button is changed to Docker

Prerequisites: You need to install Docker Desktop and set the format of your containers to Windows. You can run .Net core applications on Linux, but the full framework needs Windows.

Little Git Tricks: Use .mailmap to Merge Different Authors

With every commit you do, Git not only registers the change in your code, but marks you as the author of this change as well. It uses the settings user.name and user.email to create an entry like this one in the log:

commit aeaeb9e927592e907ae1a7f5c381876e05109a80
Author: John Doe <john@doe.org>
Date:   Mon Jun 10 20:11:11 2019 +0200
Your commit message

As long as you use Git only to manage your source code, this behaviour does not require any attention. You write your code, commit and push as you like, and everything works. However, if you intend to do any form of data mining on your Git repository, you need to look deeper on how authors of Git commits are tracked.

How to Upgrade Your Ruby on Rails Application

Ruby on Rails evolves quickly. It may not look like that, but when you go back to your applications, you find them most likely a few versions behind the current stable release. Unfortunately, you cannot simply jump from your current version to the newest one. Instead, you need to upgrade from one major version to the next one (for example: from 4.2.6 to 4.2.11, then to 5.0, 5.1, 5.2). That means the longer you wait, the more work will it take to get to the newest version.

The official Upgrading Ruby on Rails guide explains the required steps in all the details you need to know. However, there are few obstacles I run into that you do not need to repeat.

How to Manage Your Ruby Installation with rbenv

Managing the whole development environment is often a lot of work. You need to get the right tools in the right version and the paths and other environment settings must all be right – or you go on an endless hunt for one problem after another. If you work with Ruby you should look at rbenv. This little helper lets you switch between different versions of Ruby and ensures that everything works as you expect.

How to Improve the Security Headers for Your ASP.NET Application

At the user group meetup last week Damien Bod shared many valuable insights in how to protect your applications. Among the many tools he showed was securityheaders.com. Unfortunately for us, this test site calculated a very bad result for the user group site:

Result of SecurityHeaders.com: F

We took this result as a challenge to improve it quickly and to share what you need to do to improve this rating. Thanks to another tool Damien told us about it only took 10 minutes to get to the B rating.

How to Create an Event Using the Meetup.com API

Meetup.com has a well-documented API that gives you all the information about your events you can think of. Getting the attendees, the pictures taken at your event or the comments is easy, you can even try everything out online without writing a single line of code. That great developer support unfortunately ends rather abruptly when it comes to creating an event using the API. There is no online demo and the documentation itself guides you into the wrong direction.

Code Search in Azure DevOps Done Right

The code view in Azure DevOps is a great help: without installing any IDE, you can see the whole code of a project. You can brows through all the files and even make changes directly inside your web browser. The only downside is that you miss a lot of the helpful search options you get in Visual Studio. Luckily for us, the Code Search extension gives us exactly that.