This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Org.BouncyCastle.Asn1; | |
using Org.BouncyCastle.Asn1.X509; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Operators; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.Math; | |
using Org.BouncyCastle.X509; | |
using System; | |
using System.Diagnostics; | |
using System.Linq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: This requires you to have a reference to KDL for .NET, and import the kdl-net namespace | |
// https://github.com/borland/kdl-net | |
// | |
// Highly experimental, but it works. | |
// | |
// NOTE: Once you have this code in your project, you can use | |
// | |
// var config = new ConfigurationBuilder() | |
// .AddKdlFile("appsettings.kdl", optional: false, reloadOnChange: false) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
get_and_unzip () { | |
# package_name is | |
local URL="$1/$2/$2-$3.zip" | |
curl -s -o "$2.zip" "$URL" | |
unzip "$2.zip" | |
rm "$2.zip" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SingletonList<T> : IEnumerable<T>, IEnumerator<T> | |
{ | |
[ThreadStatic] | |
static readonly SingletonList<T> TransientInstance = new SingletonList<T>(); | |
public static SingletonList<T> Create(T value) => new SingletonList<T> { Value = value }; | |
public static SingletonList<T> Transient(T value) | |
{ | |
TransientInstance.Value = value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
static readonly string jsonExample = @" | |
{ | |
""intValue"": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Reachability.swift | |
// iOSSwiftScratchApp | |
// | |
// Created by Orion Edwards on 15/02/16. | |
// Copyright © 2016 Orion Edwards. All rights reserved. | |
// | |
import Foundation | |
import SystemConfiguration |