Skip to content

Instantly share code, notes, and snippets.

View joliver's full-sized avatar
💭
It's complicated

Jonathan Oliver joliver

💭
It's complicated
View GitHub Profile
@joliver
joliver / Simplified--No Nested Transactions
Created September 18, 2011 03:17
RavenDB TransactionScope Issue
using System;
using System.Diagnostics;
using System.Linq;
using System.Transactions;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Linq;
public class Program
{
@joliver
joliver / gist:1311195
Created October 25, 2011 03:16
NServiceBusCommitDispatcher
public sealed class NServiceBusCommitDispatcher : IPublishMessages
{
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
{
@joliver
joliver / gist:10545280
Created April 12, 2014 16:47
keybase.md
### Keybase proof
I hereby claim:
* I am joliver on github.
* I am joliver (https://keybase.io/joliver) on keybase.
* I have a public key whose fingerprint is B834 EF94 BA73 68A1 C02B 48BD 9C02 4FBE AC5B 8FE9
To claim this, I am signing this object:
@joliver
joliver / disruptor.go
Created May 24, 2014 05:23
Simple Disruptor Example
package main
import (
"fmt"
"runtime"
"time"
)
// the code below is loosely based upon: https://gist.github.com/tux21b/1218360
// it is only safe on 64-bit CPUs.
@joliver
joliver / gist:40291313605971545a0c1f6a3040d4c3
Created April 26, 2017 03:24
Multi-core HAProxy Sample
listen frontend-secure
mode tcp
bind :443 tfo ssl crt /etc/ssl/private/
server forward-to-internal-via-pipe abns@haproxy-pipe send-proxy
bind-process 2-4
frontend frontend-aggregate
bind abns@haproxy-pipe accept-proxy
bind-process 1
@joliver
joliver / main.go
Last active September 27, 2023 22:30
Go v1.11 net.Listener SO_REUSEPORT or SO_REUSEADDR example
package main
// This is a super-quick example of how to set the socket options to allow port re-use for a single address/port on a host machine.
// This is most commonly used with things like hot reloads of configuration.
import (
"context"
"log"
"net"
"syscall"