after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms
Now we can say:
after 500, -> # do something...
Instead of:
setTimeout ->
function cartesianProductOf(){ | |
return _.reduce(arguments, function(mtrx, vals){ | |
return _.reduce(vals, function(array, val){ | |
return array.concat( | |
_.map(mtrx, function(row){ return row.concat(val); }) | |
); | |
}, []); | |
}, [[]]); | |
} |
function cartesianProductOf(){ | |
return _.reduce(arguments, function(mtrx, vals){ | |
return _.reduce(vals, function(array, val){ | |
return array.concat( | |
_.map(mtrx, function(row){ return row.concat(val); }) | |
); | |
}, []); | |
}, [[]]); | |
} |
-- TLC - The Tiny Lua Cocoa bridge | |
-- Note: Only tested with LuaJit 2 Beta 9 on x86_64 with OS X >=10.7.3 & iPhone 4 with iOS 5 | |
-- Copyright (c) 2012, Fjölnir Ásgeirsson | |
-- Permission to use, copy, modify, and/or distribute this software for any | |
-- purpose with or without fee is hereby granted, provided that the above | |
-- copyright notice and this permission notice appear in all copies. | |
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
import time | |
import networkx as nx | |
from contextlib import contextmanager | |
@contextmanager | |
def hidden(G, nodes=None, edges=None): | |
if nodes is None: | |
nodes = [] | |
if edges is None: | |
edges = [] |
import time | |
import networkx as nx | |
from contextlib import contextmanager | |
@contextmanager | |
def hidden_nodes(G, nodes=None): | |
import types | |
if nodes is None: | |
nodes = [] | |
def successors_iter(G,n): |
after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms
Now we can say:
after 500, -> # do something...
Instead of:
setTimeout ->
# -*- coding: utf-8 -*- | |
import os | |
import StringIO | |
import hashlib | |
try: | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
except ImportError: | |
raise ImproperlyConfigured, "Could not load Boto's S3 bindings." |