Skip to content

Instantly share code, notes, and snippets.

View cache.py
import time
__CACHE = {}
def cache(ns, key, val_func=None , ttl=None):
if ttl is None or ttl <= 0 :
return val_func()
now = int(time.time())
View HttpProxy.go
package main
import (
"bufio"
"net/http"
"log"
)
func handler(w http.ResponseWriter, r *http.Request) {