Categories
Linux

tmux cheat sheet

What is tmux? It is a program which runs in a terminal and allows multiple other terminal programs to be run inside it. Each program inside tmux gets its own terminal managed by tmux, which can be accessed from the single terminal where tmux is running – this is called multiplexing and tmux is a […]

Categories
Ruby

Setup Ruby using ruby-install and chruby

There are many ways to get Ruby installed; the one that I found to be more transparent and flexible is using ruby-install and chruby. Both of them are very light tools written by Hal Brodigan. Install on MacOS If you are on Mac, you get get everything installed using Homebrew. In order for chruby to work properly, we have […]

Categories
.NET

Add a JSON configuration file to a .NET console application

A .NET application can handle configurations using different formats (providers) like memory, command line, and environment. Here, we will be using a file provider, more specifically, a JsonConfigurationProvider. Click here to learn more about the different types of configuration providers. Create the Sample Project We will start by creating a console application and adding the NuGet package for the provider. […]

Categories
.NET

Unit Testing with NHibernate

In this post, I will demonstrate how to unit test a code that uses NHibernate. Instead of mocking the persistence layer, we will be using an in-memory version of SQLite. The full source code can be found here on GitHub. In-memory Session Helper We can start by adding a helper class to create a new […]