Skip to content

Instantly share code, notes, and snippets.

View SeanFeldman's full-sized avatar

Sean Feldman SeanFeldman

View GitHub Profile
@SeanFeldman
SeanFeldman / CancellationTimeoutBehavior.cs
Created February 9, 2021 05:53 — forked from ramonsmits/CancellationTimeoutBehavior.cs
NServiceBus 7 behavior that adds a cancellation token to the context which can be retrieved by handler
//
// NServiceBus v8 will have improved support for cooperative cancellation.
//
// Register behavior:
//
// endpointConfiguration.Pipeline.Register(new CancellationTimeoutBehavior(TimeSpan.FromSeconds(5)), nameof(CancellationTimeoutBehavior));
//
using System;
using System.Threading;
using System.Threading.Tasks;
@SeanFeldman
SeanFeldman / AzureStorageEmulatorManager.cs
Last active February 3, 2020 13:56 — forked from bragma/AzureStorageEmulatorManager.cs
SetUp Fixture for NUnit starting the emulator before tests
namespace AzureTableStorage.Tests
{
using System.Diagnostics;
using System.Linq;
// Start/stop azure storage emulator from code:
// http://stackoverflow.com/questions/7547567/how-to-start-azure-storage-emulator-from-within-a-program
public static class AzureStorageEmulatorManager
{
const string AzureStorageEmulatorPath = @"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe";
@SeanFeldman
SeanFeldman / pr.md
Created December 15, 2016 17:15 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@SeanFeldman
SeanFeldman / RavenDb_PolymorphicProperty
Last active December 12, 2015 06:28
Polymorphic property with RavenDB
public class Listing
{
public string Id { get; set; }
public string Name { get; set; }
public AdditionalInfo Info { get; set; }
}
public abstract class AdditionalInfo
{
}