Skip to content

Instantly share code, notes, and snippets.

View sohjsolwin's full-sized avatar

Josh Wilson sohjsolwin

View GitHub Profile
@sohjsolwin
sohjsolwin / Examples.cs
Created June 13, 2019 13:00
Union type for bitwise comparisons
var leadSource = LeadSource.A;
var union = LeadSource.A | LeadSource.B | LeadSource.C;
Console.WriteLine(union & leadSource); //true
Console.WriteLine(union & LeadSource.B); //true
Console.WriteLine(union & LeadSource.C); //true
Console.WriteLine(union & LeadSource.D); //false
@sohjsolwin
sohjsolwin / chocolatey packages
Last active February 20, 2024 15:35
Frequently used collection of packages installed by Chocolatey
; Step 1) Install chocolatey with the following command in Powershell: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
; Step 2) Select from the list of packages below and append them to `choco install -y`, like: choco install -y chocolateygui 7zip googlechrome etc
; Step 3) Paste into a new admin powershell window and run.
; General tools
7zip
notepadplusplus
sysinternals
windirstat
wireshark
@sohjsolwin
sohjsolwin / RebuildNugetReferences.ps1
Last active March 15, 2021 18:10
Powershell: Helpful Nuget Commands
get-project -All | foreach-object { If ($PSItem.ProjectName.Contains("\")) { $PSItem.ProjectName.SubString($PSItem.ProjectName.LastIndexOf("\")+1)} else { $PSItem.ProjectName } } | foreach-object { Add-BindingRedirect $PSItem}