Skip to content

Instantly share code, notes, and snippets.

View gpresland's full-sized avatar

Greg Presland gpresland

View GitHub Profile
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
[*]
@gpresland
gpresland / Snippets.ps1
Last active August 23, 2019 20:13
PowerShell Snippets
# Get parent directory of script being executes
$base_dir = Split-Path -Parent $PSScriptRoot
# Delete contents of a folder.
Get-ChildItem <folder> -Recurse -Force | Remove-Item
# Concatenate files.
# See https://stackoverflow.com/a/53079166/779957
@gpresland
gpresland / Program.cs
Last active November 19, 2019 18:20
Press Ctrl+C to shut down.
using System.Threading;
...
public static void Main(string[] args)
{
Console.WriteLine("Press Ctrl+C to shut down.");
Console.WriteLine();
var exitEvent = new ManualResetEvent(false);
@gpresland
gpresland / MyException.cs
Last active August 8, 2019 17:32
Exception.cs
using System;
using System.Runtime.Serialization;
namespace Project.Namespace
{
/// <summary>
///
/// </summary>
[Serializable]
public class MyException : Exception