This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
disqus.flask.helpers | |
~~~~~~~~~~~ | |
:author: Adam Hitchcock | |
:copyright: (c) 2011 DISQUS, Inc. | |
:license: Apache License 2.0, see LICENSE for more details. | |
""" | |
from flask import current_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from thoonk.feeds import Job | |
from thoonk.feeds.queue import Empty | |
import time | |
# To use this do the super horrible following actions: | |
# job = pubsub.job(channel) | |
# job.__class__ = JobExtended | |
class JobExtended(Job): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gevent import spawn | |
from gevent import sleep | |
def gen(): | |
def _gen(): | |
i = 0 | |
while True: | |
yield i | |
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def recur(i=0): | |
print i | |
sys.setrecursionlimit(i + 2) | |
recur(i + 1) | |
recur(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from gevent import monkey | |
monkey.patch_all() | |
from gevent.queue import Queue | |
from gevent import sleep | |
from gevent import spawn | |
import fapws._evwsgi as evwsgi | |
from fapws import base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
realertime.lib.spawn | |
~~~~~~~~~~~~~~~~~~~~ | |
:author: Adam Hitchcock | |
:copyright: (c) 2012 DISQUS. | |
:license: Apache License 2.0, see LICENSE for more details. | |
""" | |
from __future__ import absolute_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": false, | |
"auto_complete_delay": 0, | |
"auto_complete_selector": "source - comment", | |
"auto_complete_size_limit": 4194304, | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "<", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
# this sets * = auto for all color sections | |
ui = true | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A git hook for automatically running commands | |
# based on the name of files modified in the | |
# previous changeset | |
# | |
# To install as a post-merge hook (on `git pull`): | |
# $ cp hook.sh .git/hooks/post-merge && chmod 755 $_ | |
# | |
# To install as a post-checkout hook (changing branches): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
seed = [] | |
foo = os.path.expanduser("~/foo.json") | |
def load(): | |
with open(foo, 'r') as fp: | |
return json.load(fp) |