Skip to content

Instantly share code, notes, and snippets.

View ksopyla's full-sized avatar

Krzysztof Sopyła ksopyla

View GitHub Profile
@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@jmikola
jmikola / foo.php
Created March 20, 2013 22:00
Benchmarking findOne() vs. find()->limit(1)->count(true)
<?php
$m = new MongoClient();
$c = $m->test->foo;
$c->drop();
$c->insert(['_id' => 1, 'x' => str_repeat('z', 1024*1024*4)]);
$c->insert(['_id' => 2, 'x' => str_repeat('z', 1024*1024*4)]);
$c->insert(['_id' => 3, 'x' => str_repeat('z', 1024*1024*4)]);
$c->insert(['_id' => 4, 'x' => str_repeat('z', 1024*1024*4)]);
$c->insert(['_id' => 5, 'x' => str_repeat('z', 1024*1024*4)]);
@michilu
michilu / functools_timeit.py
Created October 12, 2012 00:04 — forked from kumagi/lru.py
python lru benchmarks
#!/usr/bin/env python
from functools32 import lru_cache
from time import time
import random
import sys
def benchtime(fn):
oldtime = time()
fn()
return time() - oldtime
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n