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 | |
__author__ = 'Frank Smit <frank@61924.nl>' | |
__version__ = '0.1.0' | |
import functools | |
import psycopg2 | |
from tornado.ioloop import IOLoop, PeriodicCallback |
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 tornado.locale | |
from wtforms import Form, TextField, PasswordField, SubmitField, validators | |
# Later use e.g. FORMS['es'].LoginForm | |
FORMS = {} | |
error_msgs = ( | |
'You must enter a username.', |
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
jQuery.ajaxify({ | |
'content-id' : '#main-content', | |
'animation': [{opacity: 0}, {opacity: 1}], | |
'duration': 200, | |
'callback' : function() { | |
// Some function you want to execute after the new page has been loaded | |
} | |
}); |
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 time | |
import os.path as path | |
import misaka | |
import misaka_ctypes | |
class Benchmark(object): | |
def __init__(self, name): | |
self._name = name |
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
<?php | |
class ExampleTest extends TestLibTestCase | |
{ | |
protected $name = 'utf8\len()'; | |
public function test_equal() | |
{ | |
$this->is_equal('test', 'test'); | |
} |
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 python2 | |
""" | |
Reads a Genbank file line by line. | |
""" | |
import re | |
from pprint import pprint |
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 re | |
import socket | |
from tornado import ioloop | |
from tornado import iostream | |
RE_ORIGIN = re.compile(r'([^!]*)!?([^@]*)@?(.*)') | |
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 socket | |
from itertools import imap | |
from functools import partial | |
from collections import deque | |
from tornado import ioloop | |
from tornado import iostream | |
import hiredis |
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 https://github.com/FSX/misaka/blob/master/tests/misaka_test.py | |
import re | |
import codecs | |
from os import path | |
from glob import glob | |
from subprocess import Popen, PIPE, STDOUT | |
from minitest import TestCase, ok, runner |
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 | |
# Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/ | |
from queue import Queue | |
from threading import Thread | |
from functools import partial | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options |