Skip to content

Instantly share code, notes, and snippets.

View stand-sure's full-sized avatar

Christopher J. Anderson stand-sure

View GitHub Profile
#! /bin/bash
# Make a copy of your existing config
cp ~/.kube/config ~/.kube/config.bak
# Merge the two config files together into a new config file
KUBECONFIG=~/.kube/config:/path/to/new/config kubectl config view --flatten > /tmp/config
# TEST
@stand-sure
stand-sure / AsyncLazy.cs
Created December 3, 2020 20:24
Async version of Lazy<T>
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
//// inspired by Stephen Toub's https://devblogs.microsoft.com/pfxteam/asynclazyt/
/// <summary>
/// Provides support for async lazy initialization.
/// </summary>
/// <typeparam name="T">Specifies the type of element being lazily initialized.</typeparam>
@watfordgnf
watfordgnf / NatsServiceCollectionExtensions.cs
Created February 27, 2019 16:12
NATS from ASP.Net Core DI
using System;
using NATS.Client;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Provides extension methods for NATS registration with ASP.Net Core DI
/// </summary>
public static class NatsServiceCollectionExtensions