Skip to content

Instantly share code, notes, and snippets.

internal class MassTransitDispatcher : IObserver<ICommit>
{
private readonly IServiceBus _bus;
public MassTransitDispatcher(IServiceBus bus)
{
_bus = bus;
}
public void Dispose()
let rec getMaxOrder0 number order =
match number with
| _ when number < (pown 26 order) -> getMaxOrder0 number order + 1
| _ -> order
Task flushingTask = null;
public override Task FlushAsync(CancellationToken cancellationToken)
{
Interlocked.CompareExchange(
ref flushingTask,
Task.Delay(200, cancellationToken).ContinueWith(
async (t) =>
{
await write.FlushAsync(cancellationToken);
@larsw
larsw / gist:8053599
Created December 20, 2013 11:34
Gaaah!
<HTML>
<Head>
<Meta HTTP-Equiv="Content-Type" Content="text/html; charset=UTF-8">
<Meta HTTP-Equiv="X-UA-Compatible" Content="IE=7">
<Title>Microsoft Active Directory Certificate Services</Title>
</Head>
<Body BgColor=#FFFFFF Link=#0000FF VLink=#0000FF ALink=#0000FF OnLoad="postLoad();" ><Font ID=locPageFont Face="Arial">
<Table Border=0 CellSpacing=0 CellPadding=4 Width=100% BgColor=#008080>
@larsw
larsw / gist:7812539
Created December 5, 2013 19:45
A terse way of returning an empty enumerable instance.
public IEnumerable<object> GetObjects()
{
yield break;
}
@larsw
larsw / gist:7332621
Created November 6, 2013 08:16
Alternate strategy to match attribute route in HyprLinkr Dispatcher
public Rouple Dispatch(MethodCallExpression method, IDictionary<string, object> routeValues)
{
if (method == null)
throw new ArgumentNullException("method");
var newRouteValues = new Dictionary<string, object>(routeValues);
var controllerName = method
.Object
.Type
@larsw
larsw / gist:7133065
Created October 24, 2013 08:04
Exceptions in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'Microsoft.ServiceBus.Messaging.MessageLockLostException' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'Microsoft.ServiceBus.Messaging.MessageLockLostException' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'Microsoft.ServiceBus.Messaging.MessageLockLostException' occurred in Microsoft.S
ID4175: The issuer of the security token was not recognized by the IssuerNameRegistry. To accept security tokens from this issuer, configure the IssuerNameRegistry to return a valid name for this issuer
@larsw
larsw / gist:5618552
Created May 21, 2013 09:22
IRepository v1
public interface IRepository<TEntity>
where TEntity : class
{
TEntity Find(int id);
TEntity Find(Func<TEntity, bool> predicate);
// ...
void Add(TEntity entity);
void Remove(TEntity entity);
@larsw
larsw / gist:5248336
Created March 26, 2013 19:20
TypeScript repository - large files.
[~/code/typescript]
larsw-> sh ../findlarge.sh
All sizes are in kB's. The pack column is the size of the object, compressed, inside the pack file.
-e size pack SHA location
11410 701 b97b87db6af94f1ed6526fd836e363f1dd1e4664 src/compiler/Syntax/tests/parser/ecmascript5/RealWorld/harness.ts.expected
10889 423 aed1d1ae94a1d28a549c63c0192d0591033a6900 src/compiler/Syntax/tests/parser/ecmascript5/RealSource11.ts.expected
9956 391 1ed46cd8d8186194edfd95487b058fcbf0d79c35 src/prototype/tests/parser/ecmascript5/RealSource11.ts.actual
8950 195 0cfd8b27868358e5ae010b6ef5af51cf7c01f899 src/prototype/tests/test262/suite/ch11/11.7/11.7.3/S11.7.3_A4_T4.js.expected
8723 141 33afb754273d7927cb6d7063e744eb19591a4986 src/prototype/tests/test262/suite/ch11/11.7/11.7.2/S11.7.2_A4_T1.js.expected
4031 166 06b6f4504bbae40a968347543091df4b6c6ff8aa src/compiler/Syntax/tests/parser/ecmascript5