Snippets
This is a curated list of potentially useful snippets that I’ve published.
C#
- ArtificialStackTraceException.cs — when you need a stack trace but you don’t need to
throw
- KeyValueConfigStore.cs — simple windows registry interface
- MicroLog.cs — C# logging micro-framework
- Migrate-Db.ps1 — run schema migration scripts on a SQL Server databse
- NanoLog.cs — C# logging nano-framework
Javascript
- require.js —
require(...)
npm dependencies from the browser console
*nix
- csv2json — convert
.csv
files into.json
files - mkgitconfig — sensible Git defaults
- tun0 — openVPN integration with
interfaces(5)
PowerShell
- EnvPaths.psm1 — functions for manipulating
$env:PATH
- Get-WebFile.ps1 — download a file and verify its integrity
Python
- getuser.py — lookup user id and name from the source (read: no environmental variables consulted). Cross-platform compatible (Windows, *nix).
- knownpaths.py — Python wrapper around the
SHGetKnownFolderPath
Windows Shell function
Windows
- autoupdate.bat — hands-off script to fully patch a fresh Windows install
- delete-temp-aspnet.ps1 — delete all files in
Temporary ASP.NET Files
at boot - DeleteQueue.bat — fast-delete the files in the delete queue
- Get-AssemblyReverseReferences.ps1 — what .dll’s are referencing this .dll (and which version)?
- Get-WindowsSDKConstant.ps1 — calculate the value for any constant in the Windows SDK
- maintain-links.ps1 — automatically maintain shortcuts to files in subdirectories
- measure-lines.ps1 — find files with the most lines of code in a project