Skip to content

Instantly share code, notes, and snippets.

View maxnorth's full-sized avatar

Max North maxnorth

  • Policygenius
  • Durham, NC
View GitHub Profile
@maxnorth
maxnorth / Program.cs
Created August 30, 2020 01:17
Durable task emulator bug
using DurableTask.Core;
using System;
using System.Threading.Tasks;
using DurableTask.ServiceBus;
using DurableTask.ServiceBus.Tracking;
using DurableTask.Emulator;
namespace DurableTaskPrototype
{
class Program
@maxnorth
maxnorth / Program.cs
Last active January 22, 2020 03:15
Using environment type to optionally enable key vault provider
using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.AzureKeyVault;
namespace Example
{
public class Program
{
@maxnorth
maxnorth / KeyProvider.cs
Created January 22, 2020 02:05
Partial key rotation implementation using the Key Vault config provider
using Microsoft.Extensions.Configuration;
namespace Example
{
public interface IKeyProvider
{
string GetKey();
void SwitchKey();
}
@maxnorth
maxnorth / Example.csproj
Last active January 22, 2020 01:32
Adding the Key Vault config provider in Asp.Net Core
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0" />
</ItemGroup>
@maxnorth
maxnorth / asd
Created January 6, 2020 15:40
asdasd
asd
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourcesNamePrefix": {
"type": "string"
},
"resourcesLocation": {
"type": "string",
"allowedValues": [
type KeysOf<T> = { [x in Exclude<keyof T, keyof KeyHelper<T>>]: null }
abstract class KeyHelper<T> {
abstract $keys: KeysOf<T>;
getKeys(): (keyof T)[] {
return Object.keys(this.$keys) as (keyof T)[];
}
}
class Greeter extends KeyHelper<Greeter> {
{
"name": "tmp",
"version": "0.0.0",
"dependencies": {
"aurelia-bootstrapper-webpack": "^1.0.0",
"aurelia-event-aggregator": "^1.0.0",
"aurelia-fetch-client": "^1.0.0",
"aurelia-framework": "^1.0.0",
"aurelia-history-browser": "^1.0.0",
"aurelia-loader-webpack": "^1.0.0",