docker-desktop
microsoft-windows-terminal
git.install
github-desktop
vscode
paint.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Enumerates constants on a type. | |
/// </summary> | |
public static IEnumerable<FieldInfo> GetConstantsOnType(Type TypeToReflect) | |
{ | |
return TypeToReflect.GetFields().Where(f => f.IsStatic && f.IsLiteral); | |
} | |
/// <summary> | |
/// Enumerates constants on a type of a type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
using Dapper; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace isolationmode_demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenchmarkDotNet=v0.11.4, OS=Windows 10.0.17134.590 (1803/April2018Update/Redstone4) | |
Intel Core i7-6600U CPU 2.60GHz (Skylake), 1 CPU, 4 logical and 2 physical cores | |
.NET Core SDK=3.0.100-preview-010184 | |
[Host] : .NET Core 2.1.8 (CoreCLR 4.6.27317.03, CoreFX 4.6.27317.03), 64bit RyuJIT | |
MediumRun : .NET Core 3.0.0-preview-27324-5 (CoreCLR 4.6.27322.0, CoreFX 4.7.19.7311), 64bit RyuJIT | |
Job=MediumRun Toolchain=.NET Core 3.0 Preview 2 InvocationCount=1 | |
IterationCount=15 LaunchCount=2 UnrollFactor=1 | |
WarmupCount=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Primitives; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
// You must add the `Autofac` and `Microsoft.Extensions.Configuration` NuGet packages for this to work | |
namespace AutofacDemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ProtobufExample.Protos; | |
using System; | |
namespace ProtobufExample | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var product = new Product { Id = 2, Description = "Fun product" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory=$true)][string]$sourceFile, | |
[string]$outputFile="" | |
) | |
$MAX_LINE_LENGTH = 16000000; | |
if ($outputFile -eq "") { | |
$outputFile = '{0}.ps1' -f ($sourceFile) | |
} |
These are the Homebrew packages I have used:
brew install --cask visual-studio-code
brew install --cask github
brew install --cask firefox
brew install gh
brew install docker
This repo contains some code snippets that I've found useful related to Ruby and Rails
This is null safe for Items
in this example. 40x Faster than using ?.Any()
in a microbenchmark when Items is not null but could be empty. In cases where the list will typically be null, ?.Any()
measured about 10x faster, but these are all sub-nanosecond measurements and neither has any allocations.
public class Foo
{
public List<int>? Items { get; set; }