Skip to content

Instantly share code, notes, and snippets.

@aasmundeldhuset
aasmundeldhuset / CheckedPersonBuilder.cs
Last active December 21, 2015 14:19
An approximate C# implementation of a piece of Scala code that showed how to make builders that enforce (at compile-time) that certain properties must be set.
using System;
public class Demo
{
public static void Main()
{
Person p = CreateA.Person().WithAge(23).WithName("");
Person q = CreateA.Person().WithName("").WithAge(23);
Person r = CreateA.Person().WithName("");
// The next two don't compile because the name is not set
@aasmundeldhuset
aasmundeldhuset / devcon.bashrc
Last active September 22, 2025 15:37
Git and Bash aliases for Cognite DevCon 2025
# Store this in your ~/.bashrc file. Note that a .bashrc file is really just a regular shellscript,
# but it must be executed _inside_ the current shell instead of as a subprocess in order for its
# definitions to apply to the current shell. Alternatively, you can apply this file from within
# your ~/.bashrc (or interactively in a shell) with `source /path/to/file.bashrc`
# or `. /path/to/file.bashrc`.
# Basic aliases that simply expand to the given command (which, in the case of git,
# may involve git aliases). Note that you may append any parameters/flags when invoking the alias,