Skip to content

Instantly share code, notes, and snippets.

@cespare
cespare / log.go
Created October 31, 2012 06:51
Golang apache logging
type ApacheLogRecord struct {
http.ResponseWriter
ip string
time time.Time
method, uri, protocol string
status int
responseBytes int64
elapsedTime time.Duration
}
@submachine
submachine / gen_rand_dag.c
Created October 9, 2012 00:37
A quick-n-dirty random DAG generator
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* http://stackoverflow.com/q/12790337/274261 */
/* Generates random DAGs. The key is to 'rank' the nodes, and
only draw edges from lower ranked nodes to higher ranked ones. */
/* Nodes/Rank: How 'fat' the DAG should be. */
@daschl
daschl / couchbase-php-handler.php
Created June 25, 2012 06:15
A reference implementation of a Couchbase Session Handler with PHP
<?php
/**
* A reference implementation of a custom Couchbase session handler.
*/
class CouchbaseSessionHandler implements SessionHandlerInterface {
/**
* Holds the Couchbase connection.
*/