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
# -*- coding: utf-8 -*- | |
import os.path | |
import string | |
import sys | |
def print_buf(counter, buf): | |
buf2 = [('%02x' % ord(i)) for i in buf] | |
print '{0}: {1:<39} {2}'.format(('%07x' % (counter * 16)), | |
' '.join([''.join(buf2[i:i + 2]) for i in range(0, len(buf2), 2)]), |
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 | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
class FileSplitter(object): | |
def __init__(self): | |
self.parse_args(sys.argv) |
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
<html> | |
<head> | |
<title>TornadoMail Demo</title> | |
</head> | |
<body> | |
<form method="post" action="/"> | |
<input type="text" name="subject"/> | |
<input type="text" name="email"/> | |
<input type="submit" value="Send message"/> | |
</form> |
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
diff --git a/ad_codes/models/__init__.py b/ad_codes/models/__init__.py | |
index 5abedab..75bc44f 100644 | |
--- a/ad_codes/models/__init__.py | |
+++ b/ad_codes/models/__init__.py | |
@@ -20,12 +20,12 @@ class AdCodesFields(object): | |
tablet = fields.StringField() | |
amp = fields.StringField() | |
ia = fields.StringField() | |
+ display = fields.BooleanField(default=False) | |
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
greeting = 'Hello, World' |
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 | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import raven | |
CURRENT = os.path.dirname(__file__) | |
sys.path.insert(0, os.path.realpath(os.path.join(CURRENT, '..', '..'))) | |
sys.path.insert(1, os.path.realpath(os.path.join(CURRENT, '..', '..', 'rebelmouse'))) |
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
➜ ~ diff ez_setup.py ez_setup.py.edited | |
331c331 | |
< url = download_base + zip_name | |
--- | |
> url = 'https://pypi.python.org/packages/86/ee/622e83b0dbede6d48891ed209fa5ca83fcc485f9b6696cf56796eda40806/{}'.format(zip_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
$ cd /usr/local/src | |
$ wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz | |
$ tar -xzf Python-3.4.0b2.tgz Python-3.4.0b2 | |
$ cd Python-3.4.0b2 | |
$ ./configure --enable-shared --prefix=/usr/local | |
$ make | |
$ make altinstall | |
$ python3.4 |
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.ioloop | |
import email | |
from bonzo.smtpserver import SMTPServer | |
def receive_message(message): | |
print "New received message: " | |
print "From: " + message['from'] | |
print "Subject: " + message['subject'] |
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
# -*- coding: utf-8 *-* | |
import logging | |
import motor | |
import pymongo | |
from mongolog.handlers import MongoHandler | |
from tornado import ioloop, options, web | |
from tornado.options import options as opts | |
NewerOlder