Skip to content

Instantly share code, notes, and snippets.

View pnbv's full-sized avatar

pedro vasconcelos pnbv

View GitHub Profile
@jed
jed / LICENSE.txt
Created May 10, 2011 23:27 — forked from 140bytes/LICENSE.txt
calculate # of ms/seconds/minutes/hours/days in the past
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jdmaturen
jdmaturen / worker3.py
Created January 25, 2011 03:42
Redis stats aggregator w/ Gevent
import gevent
from gevent import monkey
monkey.patch_socket()
import hashlib
import os
import redis
@suda
suda / nginx_memcache_set_simplehttpserver.py
Created November 16, 2010 15:08
[Python] Simple backend for nginx memcached module
"""
Simple backend for nginx memcached module
Written by Wojtek 'suda' Siudzinski <admin@suda.pl>
Gist: https://gist.github.com/701904
Nginx config:
location /static {
add_header X-Origin Memcached;
expires modified +48h;
#! /bin/sh
if test "$2" = ""; then
echo "usage: $0 basedir depth"
exit 1
fi
if test "$2" = "0"; then
exit 0
fi