Skip to content

Instantly share code, notes, and snippets.

View swedishkid's full-sized avatar

Kasper Eklander swedishkid

  • Copenhagen, Denmark
View GitHub Profile
@swedishkid
swedishkid / gist:4135823
Created November 23, 2012 14:16 — forked from fxsjy/gist:3291755
Memcached in JavaScript based on Node.JS
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 100 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru