Skip to content

Instantly share code, notes, and snippets.

def cache_method(name):
def dict_cache_wrapper(fn):
cache = {}
def wrapper(*args):
if args not in cache:
cache[args] = fn(*args)
return cache[args]
@samtardif
samtardif / filter.js
Created August 25, 2011 08:03
filter for lifestream
$("#filter").live("keyup", function (ev) {
var $filter = $(this),
keyCode = ev.keyCode || ev.which,
search;
if (keyCode === 27) { //ESC
$filter.val("");
}
search = $(this).val();
<!doctype html>
<!-- test -->
<html>
<head>
<title>Deferred pipes</title>
<style type="text/css">
div {
display: none;
position: absolute;
top: 50px;