Skip to content

Instantly share code, notes, and snippets.

View peteraritchie's full-sized avatar
😖

Peter Ritchie peteraritchie

😖
View GitHub Profile
@peteraritchie
peteraritchie / visual-studio-classes.ps1
Created February 27, 2024 16:02
A work in progress for a couple (maybe more) classes to wrap some `dotnet new` commands.
<# e.g.:
. .\visual-studio-classes.ps1
$csproj = [Project]::CreateClassLib(".\Solution\ClassLib\ClassLib.csproj");
$csproj.AddClass('MyClass');
#>
class Project {
[string]$Folder;
Project() {

Visual Studio HTTP Files

env

{
  "dev": {
    "ClientSecret": {
      "provider": "AzureKeyVault",
      "secretName": "clientSecret",
@peteraritchie
peteraritchie / search-replace-try-catch.md
Created December 12, 2023 22:34
Search and replace try/catch in C#

Search for

^(?'tab'\s*)try\s*\r?\n+\k<tab>\{\r?\n(?'tried'(.*\r?\n)+)\k<tab>\}\r?\n\k<tab>catch\s+.*\r?\n\k<tab>\{\s*\r?\n(?'caught'(.*\r?\n)+)\k<tab>\}(\r?\n)+

Replace with:

${tried}

dotnet new sln -n MySolution
gci -r '*.csproj' | ForEach-Object { dotnet sln MySolution.sln add $_.FullName;}

Akin's Laws Spacecraft Design

From Akin's Laws of Spacecraft Design

  1. Engineering is done with numbers. Analysis without numbers is only an opinion.

  2. To design a spacecraft right takes an infinite amount of effort. This is why it's a good idea to design them to operate when some things are wrong .

  3. Design is an iterative process. The necessary number of iterations is one more than the number you have currently done. This is true at any point in time.

RFC 1924

!#$%&()*+-0123456789;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~

Base85

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu

Simple Estimate

A simple rule of thumb: Estimate that you'll need one parallel job for every four to five users in your organization.

Details Estimate

In the following scenarios, you might need multiple parallel jobs:

  • If you have multiple teams, and if each of them requires a CI build, you'll likely need a parallel job for each team.
  • If your CI build trigger applies to multiple branches, you'll likely need a parallel job for each active branch.
  • If you develop multiple applications by using one organization or server, y

Microsoft Visual Studio SLN GUIDs

[Canonical project GUID reference][1]

As of 2023-7-12:

Type GUID
Microsoft.NET.Sdk C# projects (.csproj) 9A19103F-16F7-4668-BE54-9A1E7A4F7556
Microsoft.NET.Sdk Visual Basic projects (.vbproj) 778DAE3C-4631-46EA-AA77-85C1314464D9