Skip to content

Instantly share code, notes, and snippets.

View jaredpar's full-sized avatar

Jared Parsons jaredpar

View GitHub Profile
function Parse-Channels([string]$repo) {
$output = Invoke-Expression "& darc get-default-channels --source-repo $repo"
$map = @{ }
foreach ($line in $output) {
$parts = $line.Split('@')
$repoUrl = $parts[0].Split(' ')[1].Trim()
if (-not $repoUrl.EndsWith($repo)) {
continue
<Project>
<PropertyGroup>
<AllowUnsafeBlocks Condition="'$(Unsafe)' != ''">$(Unsafe)</AllowUnsafeBlocks>
</PropertyGroup>
</Project>
@jaredpar
jaredpar / community-standup-explained.cs
Created January 12, 2023 23:35
This is the code I demonstrated at the .NET Community Standup on 2023/1/12 with comments to explain how it works.
using System;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
#nullable disable
// The stand up link https://www.youtube.com/watch?v=jaPk6Nt33KM
// String vs. string
@jaredpar
jaredpar / horror.txt
Last active September 13, 2022 21:03
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\Asal\TokenService\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CrossRepositorySearch\ServiceHub\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\ModelBuilder\AutoMLService\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\RemoteAgent\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\VsTest\TestHost\System.Collections.Immutable.dll
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft
  1. ref and ref readonly parameters require the arguments are an lvalue and ...

    1. Use ref as a call site annotation for either
    2. Use in as a call site for ref readonly
    3. Using no annotation is allowed for ref readonly but leads to a warning, for ref it leads to an error
    4. Using out at the call site leads to an error
  2. in parameters require the arguments ...

    1. Use in or no annotation at the call site
    2. Using ref at the call site is allowed but leads to a warning
  3. Using out at the call site leads to an error

@jaredpar
jaredpar / determinitsic-example.cmd
Created January 20, 2022 17:21
Example of using PathMap to get identical builds across paths
C:\Users\jaredpar\temp\example> dotnet new classlib
The template "Class Library" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on C:\Users\jaredpar\temp\example\example.csproj...
Determining projects to restore...
Restored C:\Users\jaredpar\temp\example\example.csproj (in 49 ms).
Restore succeeded.
C:\Users\jaredpar\temp\example> dotnet build
{
"compilation": {
"toolsVersions": {
"compilerVersion": "4.1.0-dev",
"runtimeVersion": "6.0.0-rc.1.21451.13+d7619cd4b165c13430484e381042f055d4c5a9c7",
"framework": ".NET 6.0.0-rc.1.21451.13",
"os": "Microsoft Windows 10.0.19043"
},
"options": {
"outputKind": "ConsoleApplication",
Job Name Average succeeded time (minutes) Average time (minutes) Total time per day (minutes) Count per day Queue Container
Build Android x64 Release AllSubsets_Mono_RuntimeTests 110.51 107.57 2843.47 26 BuildPool.Ubuntu.1804.Amd64.Open mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android-20200422191843-e2c3f83
Build Browser wasm Release AllSubsets_Mono 69.84 68.59 3105.62 45 BuildPool.Ubuntu.1804.Amd64.Open mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20210531091624-f5c7a43
Build Browser wasm Release AllSubsets_Mono_AOT 86.64 85.09 3801.68 45 BuildPool.Ubuntu.1804.Amd64.Open mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20210531091624-f5c7a43
Build Browser wasm Release AllSubsets_Mono_EAT 78.07 76.53 3417.12 45 BuildPool.Ubuntu.1804.Amd64.Open mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20210531091624-f5c7a43
Build Browser wasm Release AllSubsets_Mono_RuntimeTests 70.86 69.55 1840.17 26 BuildPool.Ubuntu.1804.Amd64.Open mcr.mi
08/19/2021 00:12 22
08/19/2021 00:27 19
08/19/2021 00:42 34
08/19/2021 00:57 60
08/19/2021 01:12 44
08/19/2021 01:27 25
08/19/2021 01:42 28
08/19/2021 01:57 42
08/19/2021 02:12 31
08/19/2021 02:27 43
686 CoreCLR Product Build OSX x64 checked: 41.94 (5.47%)
686 CoreCLR Product Build OSX arm64 release: 41.59 (5.42%)
686 Libraries Build OSX x64 Debug: 39.39 (5.14%)
686 CoreCLR Product Build OSX x64 release: 38.93 (5.08%)
686 Installer Build and Test coreclr OSX_x64 Release: 34.86 (4.55%)
686 CoreCLR Product Build OSX arm64 checked: 32.90 (4.29%)
686 Mono crossaot Product Build OSX x64 release: 32.37 (4.22%)
686 Build iOS arm Release AllSubsets_Mono: 30.22 (3.94%)
686 Build tvOS arm64 Release AllSubsets_Mono: 29.55 (3.85%)
686 CoreCLR Pri0 Runtime Tests Run OSX x64 checked: 28.83 (3.76%)