Skip to content

Instantly share code, notes, and snippets.

shadow-cs / LambdaVsMethod.cs
Created Aug 20, 2021
A benchmark for using various methods of passing a delegate
View LambdaVsMethod.cs
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Benchmark
private static int Executor(Func<int> a) => a();
shadow-cs / JsonSchemaLoader.cs
Created Sep 30, 2020
Loading external $ref schemas using json-everything
View JsonSchemaLoader.cs
// See
public class JsonSchemaLoader
private static JsonSchema Load(string schemaFile, ValidationOptions options)
var schemaFullPath = Path.GetFullPath(schemaFile);
var schemaUri = new Uri(schemaFullPath);
var json = File.ReadAllText(schemaFile);
return Load(schemaUri, json, options);
shadow-cs / NetMQTest.csproj
Last active Feb 13, 2020
NetMQ async exceptions
View NetMQTest.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
shadow-cs / Counter.cs
Created Nov 9, 2019
Blazor Code behind
View Counter.cs
namespace CodeBehindTest.Pages
public partial class Counter
private int currentCount = 0;
private void IncrementCount()
shadow-cs / Items.targets
Last active Nov 18, 2021
MSBuild: Selecting first and last items in an ItemGroup
View Items.targets
<Project DefaultTargets="Default">
<Items Include="One;Two;Three;Four;Five" />
<Target Name="Default">
<Reversed Include="@(Items->Reverse())" />