Skip to content

Instantly share code, notes, and snippets.

🌞
building

Reuben Bond ReubenBond

🌞
building
Block or report user

Report or block ReubenBond

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ReubenBond
ReubenBond / ILFieldBuilder.cs
Created Oct 12, 2016
Generating static fields on the fly in C# (for use in other codegen)
View ILFieldBuilder.cs
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 / Disable-AutomaticallyDetectSettings.ps1
Created Nov 23, 2011
Disable 'Automatically detect settings' in Internet Explorer's proxy settings dialog.
View Disable-AutomaticallyDetectSettings.ps1
# Disable 'Automatically detect proxy settings' in Internet Explorer.
function Disable-AutomaticallyDetectProxySettings
{
# Read connection settings from Internet Explorer.
$regKeyPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\"
$conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings
# Index into DefaultConnectionSettings where the relevant flag resides.
$flagIndex = 8
View AddShutdownTask.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Orleans.Runtime;
namespace Orleans.Hosting
{
@ReubenBond
ReubenBond / ClusterManifestTemplate.xml
Last active Apr 16, 2019
Speedy Service Fabric Dev Cluster Upgrades
View ClusterManifestTemplate.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
The settings used within this ClusterManifest are expressly for use only
within a developer single-box environment. Any use of these settings outside
of that environment are highly likely to produce incorrect, and misperforming
View ValueStopwatch.cs
using System;
using System.Diagnostics;
namespace Orleans.Runtime
{
/// <summary>
/// Non-allocating stopwatch for timing durations.
/// </summary>
internal struct ValueStopwatch
{
View PseudoCodeProgram.cs
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;
@ReubenBond
ReubenBond / veh_hook.cpp
Created Dec 19, 2017
INT3 Vectored Exception Handler hooking
View veh_hook.cpp
/**
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;
View OptInJsonSerializer.cs
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Orleans;
using Orleans.Runtime;
using Orleans.Serialization;
namespace Tester
{
View OrleansListDynamic.csproj
<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 Sep 19, 2018
CoreCLR TieredCompilation JIT bug
View Program.cs
using System;
namespace TierJit
{
class Program
{
static void Main(string[] args)
{
var array = new byte[] {0x00, 0x01};
var reader = new BinaryTokenStreamReader(array);
You can’t perform that action at this time.