Skip to content

Instantly share code, notes, and snippets.

View rossmerr's full-sized avatar

Ross Merrigan rossmerr

View GitHub Profile
@rossmerr
rossmerr / id.go
Created April 29, 2020 15:40
golang string pointer unmarshal
type ID string
func (s *ID) UnmarshalJSON(b []byte) error {
var v string
err := json.Unmarshal(b, &v)
if err != nil {
return err
}
*s = ID(v)
@rossmerr
rossmerr / keybase.md
Created February 26, 2018 16:05
keybase.md

Keybase proof

I hereby claim:

  • I am rossmerr on github.
  • I am rossmerr (https://keybase.io/rossmerr) on keybase.
  • I have a public key ASCQlfw2DKwrV-7Sj7Xk6uDLjlUujb1D8RduGoUpV1VjPQo

To claim this, I am signing this object:

@rossmerr
rossmerr / cloudSettings
Last active April 18, 2017 23:13
Visual Studio Code Sync Settings Gist
{"lastUpload":"2017-04-18T21:18:18.409Z","extensionVersion":"v2.6.2"}
metric Order Month Furniture Office Supplies Technology
Cost 2011-01-01 00:00:00 0.7111756045105666 0.7828863426080579 0.5047436891235693
Cost 2011-02-01 00:00:00 0.7735896597604033 0.5576691145468795 0.5033405036462606
Cost 2011-03-01 00:00:00 0.5530029054562966 0.7485473664269193 0.9102953901617419
Cost 2011-04-01 00:00:00 0.6283635465533035 0.8410982739367479 0.5895793683884352
Cost 2011-05-01 00:00:00 0.5445991807613348 0.7430376497561306 0.6784338045514724
Cost 2011-06-01 00:00:00 0.6258518359777552 0.7917201095094983 0.5531832573664437
Cost 2011-07-01 00:00:00 0.5957739553664274 0.9117611462009347 0.6446096481782215
Cost 2011-08-01 00:00:00 0.5984749054716585 0.7535971633610465 0.5198525110900314
Cost 2011-09-01 00:00:00 0.6864336777949813 0.8272848499591208 0.8181442958009517
date close
1-May-12 58.13
30-Apr-12 53.98
27-Apr-12 67.00
26-Apr-12 89.70
25-Apr-12 99.00
24-Apr-12 130.28
23-Apr-12 166.70
20-Apr-12 234.98
19-Apr-12 345.44
public class BloomFilter<T>
{
/// <summary>
/// A function that can be used to hash input.
/// </summary>
/// <param name="input">The values to be hashed.</param>
/// <returns>The resulting hash code.</returns>
public delegate int HashFunction(T input);
readonly HashFunction _getHashSecondary;
{
"id": "nginx",
"container": {
"type": "DOCKER",
"docker": {
"image": "nginx:1.7.7",
"network": "BRIDGE",
"portMappings": [
{ "hostPort": 0, "containerPort": 80, "servicePort": 10000 }
],
{
"id": "marathon-lb-autoscale",
"args":[
"--marathon", "http://leader.mesos:8080",
"--haproxy", "http://marathon-lb.marathon.mesos:9090",
"--target-rps", "100",
"--apps", "nginx_10000"
],
"cpus": 0.1,
"mem": 16.0,
@rossmerr
rossmerr / CompressionMiddleware.cs
Created January 27, 2016 17:36
A gzip, deflate compression middleware for vNext, ASP.NET Core
public class CompressionMiddleware
{
private readonly RequestDelegate _next;
public CompressionMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context)
@rossmerr
rossmerr / Log4NetLoggerProvider
Created June 6, 2015 20:13
Log4NetLoggerProvider for ASP.NET 5 (vnext)
using System;
using log4net;
using Microsoft.Framework.Logging;
namespace Maps.Infrastructure.Logging
{
public class Log4NetLoggerProvider : ILoggerProvider
{
public ILogger CreateLogger(string name)
{