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
// Highly compact JSON beautifier/formatter. Not very efficient and could definitely be improved. The main issue is with | |
// the number of allocations and memory presure being placed on the heap and garbage collector if the input is large. | |
// It is the shortest in terms of code size though. | |
// Source: http://stackoverflow.com/questions/4580397/json-formatter-in-c/24782322#24782322 | |
private const string INDENT_STRING = " "; | |
static string FormatJson(string json) { | |
int indentation = 0; |
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
# Warnings to treat as errors | |
# See end of script for descriptions | |
$cSharpWarnings = '162,168,169,219,1717,0067,649,618,183,184,1060,1058,809,672,612,1522,465,1998' | |
$formatting = ',1570,1574' | |
$interopWarnings = ',626,684,824' | |
$casWarnings = ',688' | |
$warnings = $cSharpWarnings + $formatting + $interopWarnings + $casWarnings | |
Get-ChildItem *.csproj -Recurse | % { |
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
$reportFileName = 'dupfinder.html' | |
$dupFindLocation = 'C:\dev\tools\ReSharperCliTools\dupfinder.exe' | |
if (-not (Test-Path $dupFindLocation)) { | |
Write-Host "dupfinder.exe not found in path $dupFindLocation" | |
Write-Host "Download tools from https://www.jetbrains.com/help/resharper/2017.1/ReSharper_Command_Line_Tools.html" | |
exit | |
} | |
$xsl = '<?xml version="1.0" encoding="utf-8"?> |
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
# sudo -s | |
# Then (do not resize the terminal window. Seems to affect the ability to accept the MS EULA): | |
# curl -Lks https://gist.githubusercontent.com/badmotorfinger/b8f0665125629ed105cb0f3574a20713/raw/eee6723994c3a07d51f13e004a58ebeaaea18b19/fresh-install.sh | /bin/bash | |
# Prevent Windows and Linux fighting over time. Prevent Linux from changing time on the mobo | |
timedatectl set-local-rtc 1 --adjust-system-clock | |
# Proton VPN |
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
# Define the directory to hash | |
$dir = "C:\Path\To\Directory" | |
# Define the hash algorithm to use | |
$hashAlgorithm = "SHA256" | |
# Get all files in the directory (including subdirectories) | |
$files = Get-ChildItem -Path $dir -Recurse | Where-Object {!$_.PSIsContainer} | |
# Create an empty hash object |
OlderNewer