This file contains hidden or 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 System; | |
// Tested on .NET Core 2.1 | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.CancelKeyPress += OnSigInt; | |
AppDomain.CurrentDomain.ProcessExit += OnSigTerm; |
This file contains hidden or 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
// https://gist.github.com/jaykang920/8234457 | |
using System; | |
using System.Security.Cryptography; | |
/// <summary> | |
/// A fast thread-safe wrapper for the default pseudo-random number generator. | |
/// </summary> | |
public static class PseudoRandom | |
{ |
This file contains hidden or 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
// https://gist.github.com/jaykang920/8234393 | |
using System; | |
using System.IO; | |
using System.Reflection; | |
/// <summary>Getopt is a clone of the GNU C getopt.</summary> | |
public class Getopt | |
{ | |
/// <summary>Indicates that the option does not take an argument.</summary> |