Skip to content

Instantly share code, notes, and snippets.

ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+v+Frl70ihyhVRe0hQyAFqbwcZbGiYsZh14xGa2gC8JKWm3mVTU2ddgu3JG6TbEvWTji0PbmFKnHeYWp+Ci6ectGjjg+JiRGuR1SAB+80I2VUNiO2W7wSQgBMcVVgjSIBaJbsKsC6ZoPeWqESMaQ8qcg1z+1A4057k/OZTBgmTw0Nj4DVKubPIG3IgQ3YOONv665TSUdTgo/25Xet3e4KL24z9gkOSbOe4imjA2+Y2xabxvvrBU8mLqFlZwPZon+FpH5Ldg0r8+cDGla8ftluL4YwkBQg98mUG98u7x3leJM2XvwfsdcXYlKqSe0YpY+64DNjZeGGkzVHsyzmawbV
hostname: k3os-server1
k3os:
password: rancher
token: secret
ntp_servers:
- 0.uk.pool.ntp.org
- 1.uk.pool.ntp.org
@cjrpriest
cjrpriest / AsyncAwaitMocksWithRuntimeTypes.cs
Created April 20, 2018 17:34
how can I create mocks around generic types, where I only know the types at runtime, and I also get full async/await functionality? This seems to be very hard, and maybe impossible...
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using NSubstitute;
using NSubstitute.Core;
@cjrpriest
cjrpriest / SealedInternal.cs
Created April 20, 2018 08:22
a demonstration that by making a class sealed, it's possible for it to take a generic parameter of an internal type, and still have that class referenced by other assemblies
using NSubstitute;
namespace ConsoleApp
{
public class SealedInternal
{
public void Run()
{
// this executes fine
Substitute.For<IDoSomething>()
@cjrpriest
cjrpriest / Command.cs
Created February 20, 2018 07:03
AzureFromTheTrenches.Commanding custom CommandDispatcher
using AzureFromTheTrenches.Commanding.Abstractions;
namespace ConsoleApp4
{
public class Command : ICommand
{
}
}
using System;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Lambda.Core;
using AzureFromTheTrenches.Commanding.Abstractions;
using AzureFromTheTrenches.Commanding.Abstractions.Model;
using Microsoft.Extensions.DependencyInjection;
namespace AsyncCommandDispatcher
{
@cjrpriest
cjrpriest / Program.cs
Created February 14, 2018 12:27
Repo for possible bug in AzureFromTheTrenches.Commanding framework
/*
Nuget packages included:
- AzureFromTheTrenches.Commanding 6.1.0
- AzureFromTheTrenches.Commanding.MicrosoftDependencyInjection 6.1.0
- Microsoft.Extensions.DependencyInjection 2.0.0
*/
using System;
using System.Threading.Tasks;
using AzureFromTheTrenches.Commanding;