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 / GuidJsonConverter.cs
Created January 7, 2016 10:25
Guid Json Converter for Orleans / Json.NET
using System;
using Newtonsoft.Json;
namespace ServiceCommon.Utilities.Serialization
{
/// <summary>
/// JSON converter for <see cref="Guid"/>.
/// </summary>
public class GuidJsonConverter : JsonConverter
{
Ready
****** START compiling Hagar.Buffers.Reader`1[ReadOnlySequence`1][System.Buffers.ReadOnlySequence`1[System.Byte]]:ReadByte():ubyte:this (MethodHash=011f4f14)
Generating code for Windows x64
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = true
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
IL to import:
@ReubenBond
ReubenBond / veh_hook.cpp
Created December 19, 2017 22:58
INT3 Vectored Exception Handler hooking
/**
veh_hook Vectored Exception Handler hooking library
Version: 24-March-2008
**/
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include "veh_hook.h"
static veh_list_t* list = NULL;
@ReubenBond
ReubenBond / ILFieldBuilder.cs
Created October 12, 2016 01:58
Generating static fields on the fly in C# (for use in other codegen)
using System;
using System.Collections.Concurrent;
using System.Reflection;
using System.Reflection.Emit;
internal class ILFieldBuilder
{
private static readonly AssemblyBuilder AssemblyBuilder =
AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName(nameof(ILFieldBuilder)),
@ReubenBond
ReubenBond / killall.ps1
Last active May 20, 2020 18:33
killall cmd for PowerShell with completion
# In a PS terminal, type "code $profile" and put this in there
function killall {
param(
[ArgumentCompleter(
{
param($cmd, $param, $values)
get-process |
? { $_.Name.StartsWith($values, [StringComparison]::OrdinalIgnoreCase) } |
@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
{