Skip to content

Instantly share code, notes, and snippets.

View fabito's full-sized avatar
🐮
Working from home

Fábio Franco Uechi fabito

🐮
Working from home
View GitHub Profile
@fabito
fabito / Vagrantfile
Last active August 29, 2015 14:07 — forked from jklein/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
import functools
import logging
from google.appengine.api import memcache
def cached(time=1200):
"""
Decorator that caches the result of a method for the specified time in seconds.
Use it as:
var socket = io.connect(window.location.host);
var received;
socket.on('data', function (data) {
received = JSON.parse(data);
});