Skip to content

Instantly share code, notes, and snippets.

@BlythMeister
BlythMeister / NUnit4Migrate.cs
Last active April 4, 2024 14:28
NUnit 4 Breaking Change Migration
void Main()
{
var rootDir = @"F:\GIT\Repo";
var classicAssert = true;
foreach (var projFile in Directory.GetFiles(rootDir, "*.*proj", SearchOption.AllDirectories))
{
var projContent = File.ReadAllLines(projFile);
if (projContent.Any(line => line.Contains("NUnit", StringComparison.InvariantCultureIgnoreCase)))
{
@BlythMeister
BlythMeister / Update-Force-Test-0.md
Last active April 22, 2024 09:00
Update Force Test Report #powershell #chocolatey
@BlythMeister
BlythMeister / Update-AUPackages.md
Last active April 26, 2024 18:00
Update-AUPackages Report #powershell #chocolatey
@BlythMeister
BlythMeister / MarkFilesAsViewed.linq
Last active September 28, 2021 08:28
GitHub Mark Files As Viewed
<Query Kind="Program">
<NuGetReference Prerelease="true">Octokit.GraphQL</NuGetReference>
<Namespace>Octokit.GraphQL</Namespace>
<Namespace>Octokit.GraphQL.Model</Namespace>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
async Task Main()
{
@BlythMeister
BlythMeister / Program.cs
Created June 11, 2021 13:24
Sweepstake
void Main()
{
var teams = File.ReadAllLines(@"C:\users\chris.blyth\Desktop\Teams.txt").ToList();
var people = File.ReadAllLines(@"C:\users\chris.blyth\Desktop\People.txt").ToList();
if (teams.Count > people.Count)
{
var missingPeople = teams.Count - people.Count;
for (int i = 0; i < missingPeople; i++)
{
<Query Kind="Program">
<NuGetReference>Octokit</NuGetReference>
<Namespace>Octokit</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
GitHubClient githubClient;
/* START SETTINGS */
string githubToken = "[TOKEN]";
@BlythMeister
BlythMeister / RepoMigrate.cs
Last active April 7, 2021 14:41
Repo Migrate Folder With History
void Main()
{
var originalRepo = "git@github.com:_**_/_**_.git";
var originalRepoBranch = "master";
var newRepo = "git@github.com:_**_/_**_.git";
var newRepoBranch = "master";
var workInProgressDir = @"C:\Temp\RepoCopy";
var relativeFolderToMigrate = "src/path";
MigrateRepo(originalRepo, originalRepoBranch, newRepo, newRepoBranch, workInProgressDir, relativeFolderToMigrate);
}
@BlythMeister
BlythMeister / BankHolidaysToOutlook.linq
Created March 29, 2021 09:25
Bank Holidays To Outlook
<Query Kind="Program">
<NuGetReference>NetOfficeFw.Outlook</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<Namespace>NetOffice</Namespace>
<Namespace>NetOffice.OutlookApi</Namespace>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>System.Net</Namespace>
<Namespace>NetOffice.OutlookApi.Enums</Namespace>
</Query>
@BlythMeister
BlythMeister / RebootMachine.json
Last active November 20, 2020 20:34
Octopus Tentacle Reboot Step Templates
{
"Id": "dfbf8776-b178-46f4-9bd2-f242c74d2551",
"Name": "Reboot Machine",
"Description": "Will reboot a tentacle without it noticing in a deploy",
"ActionType": "Octopus.Script",
"Version": 1,
"CommunityActionTemplateId": null,
"Packages": [],
"Properties": {
"Octopus.Action.Script.ScriptSource": "Inline",
@BlythMeister
BlythMeister / PaketSort
Created March 7, 2019 07:45
Will update, sort, simplify and install paket dependencies in a repo
void Main()
{
Run(@"C:\My\Repo\Root");
}
void Run(string rootDir)
{
Console.WriteLine($"Starting at {DateTime.UtcNow.ToString("u")}");
Console.WriteLine($"Running against: {rootDir}");
RunPaketCommand(rootDir, "update");