Skip to content

Instantly share code, notes, and snippets.

View eldritchideen's full-sized avatar

Steven Cook eldritchideen

  • Amazon Web Services
  • Australia
View GitHub Profile
@eldritchideen
eldritchideen / readme.md
Last active April 22, 2017 23:41
HTTP Server Micro-Benchmarks

HTTP Server Micro-Benchmarks

Here are the results of testing returning a small text string from a HTTP request implemented in various languages all, tested under the same conditions. The command used to test the server implementations was:

wrk -c 40 -d 60s -t 2 --latency http://localhost:3000

Python3

This test used the new async support in python 3.5.

@eldritchideen
eldritchideen / gist:e56a9dc5ad9b9ec9967a54bd5bd2346e
Last active July 11, 2016 19:40 — forked from SegFaultAX/gist:1f8900efb422888eabab
clojure.core/partition and clojure.core/partition-all in Python
def take_while(fn, coll):
"""Yield values from coll until fn is False"""
for e in coll:
if fn(e):
yield e
else:
return
def partition(n, coll, step=None):
return take_while(lambda e: len(e) == n,
@eldritchideen
eldritchideen / main.go
Created December 15, 2016 10:35 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
package main
import (
"fmt"
"math"
"math/rand"
"github.com/gonum/matrix/mat64"
)
@eldritchideen
eldritchideen / main.go
Created January 30, 2017 01:37
Simple Go Site with Auth
package main
import (
"html/template"
"log"
"net/http"
"net/url"
"time"
)
@eldritchideen
eldritchideen / tg2p.st
Created April 2, 2018 04:40 — forked from jdevoo/tg2p.st
Not so Terse Guide to Pharo
"**************************************************************************
* Allowable characters: *
* - a-z *
* - A-Z *
* - 0-9 *
* - .+/\*~<>@%|&? *
* - blank, tab, cr, ff, lf *
* *
* Variables: *
* - variables must be declared before use *