Skip to content

Instantly share code, notes, and snippets.

View liushuaikobe's full-sized avatar

Shuai Liu liushuaikobe

  • Alibaba
  • Hangzhou, China
  • 06:06 (UTC +08:00)
View GitHub Profile
from gevent import monkey; monkey.patch_all()
import gevent
import gevent.greenlet
from functools import partial
from random import random
import urllib
import urllib2
def on_exception(fun, greenlet):
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
import gevent.monkey
gevent.monkey.patch_all()
import time
import pymongo
connection = pymongo.Connection(use_greenlets=True)
def task():
collection = connection.autoref.all_cars