Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🌞
building

Reuben Bond ReubenBond

🌞
building
View GitHub Profile
@ReubenBond
ReubenBond / Program.cs
Last active May 5, 2020 18:29
StallDumper - dump Windows process memory when it stops emitting ETW events for a given provider for too long
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@ReubenBond
ReubenBond / RuntimeTypeNameFormatter.cs
Created April 30, 2020 13:50
CLR Type Parser/Formatter
using System;
using System.Collections.Concurrent;
using System.Reflection;
using System.Text;
namespace gentest
{
/// <summary>
/// Utility methods for formatting <see cref="Type"/> instances in a way which can be parsed by
/// <see cref="Type.GetType(string)"/>.
@ReubenBond
ReubenBond / Program.cs
Last active January 16, 2020 03:19
Orleans localhost demo
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.Hosting;
using System;
using System.Threading;
using System.Threading.Tasks;
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Orleans.Runtime;
namespace Orleans.Hosting
{
using System;
using System.Diagnostics;
namespace Orleans.Runtime
{
/// <summary>
/// Non-allocating stopwatch for timing durations.
/// </summary>
internal struct ValueStopwatch
{
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.ApplicationParts;
using Orleans.Configuration;
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Orleans;
using Orleans.Runtime;
using Orleans.Serialization;
namespace Tester
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="2.1.0">
@ReubenBond
ReubenBond / Program.cs
Created September 19, 2018 02:33
CoreCLR TieredCompilation JIT bug
using System;
namespace TierJit
{
class Program
{
static void Main(string[] args)
{
var array = new byte[] {0x00, 0x01};
var reader = new BinaryTokenStreamReader(array);
@ReubenBond
ReubenBond / BlockingCollection_ConcurrentBag_Issue.cs
Last active July 2, 2018 07:56
Demonstrates an InvalidOperationException when using BlockingCollection with ConcurrentBag as the underlying collection and calling TryTakeFromAny
using System;
using System.Collections.Concurrent;
using System.Threading;
namespace BlockingCollectionConcurrentBagException
{
class Program
{
static void Main(string[] args)
{