Skip to content

Instantly share code, notes, and snippets.

let fibonacci = {
[Symbol.iterator]() {
let pre = 0, cur = 1;
return {
next(p) {
console.log(p);
pre = cur
cur = pre + cur
//[pre, cur] = [cur, pre + cur];
if (cur < 100) {
#!/usr/bin/env python
from os import listdir
from os.path import isfile, join
from subprocess import Popen, PIPE, STDOUT, call
import MySQLdb
import MySQLdb.cursors
import types
import warnings
@bbarrows
bbarrows / LiveThread.py
Created June 25, 2012 17:56
LiveThread
import threading, logging, traceback
import sys, time
class LiveThread(threading.Thread):
def __init__(self, function_to_quit_the_process, thread_wait_in_seconds=1,
clean_up_wait_in_seconds=1, group=None, target=None, name="LiveThread",
args=(), kwargs={}, verbose=None, clean_up=None):
threading.Thread.__init__(self, group=group, target=target, name=name,
args=args, kwargs=kwargs, verbose=verbose)
self._function_to_quit_the_process = function_to_quit_the_process