Skip to content

Instantly share code, notes, and snippets.

View maximilien's full-sized avatar
💼
@ SVL and 🏠

dr.max maximilien

💼
@ SVL and 🏠
View GitHub Profile
@tedsuo
tedsuo / 1-bank.go
Last active March 7, 2016 08:22
Why golang favors code generation for protocols
// When writing an application, we want to stick to the details that are specific
// to our application domain. We don't want to write generic code that deals with
// contemporary issues, such as "what type of client would like to connect to us today?"
package bank
// The Account interface represents our application's protocol.
// We'd like to never have to write the generic transport protocol code.
type Account interface{
HowFarInTheHoleAmI() Farthings
}
@giwa
giwa / stat_basic.py
Last active August 29, 2015 14:08
Set of basic statistic operations
# Set of basic statistics operations
#
import math
def median(items):
"""
Return median
if number of items is odd, return average of 2 middles.
{
"parameters":[
"tag1, tag2, tag3",
]
}
@jonmorehouse
jonmorehouse / tar.go
Created February 17, 2014 22:29
Quick golang script for creating a gzipped tarball
package main
import (
"os"
"archive/tar"
"log"
"io"
"compress/gzip"
)