This file contains hidden or 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
| SetHandler python-program | |
| PythonHandler django.core.handlers.modpython | |
| SetEnv DJANGO_SETTINGS_MODULE myproject.settings | |
| PythonDebug On | |
| PythonPAth "['/home/darkrho/django_sites'] + sys.path" | |
This file contains hidden or 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 __future__ import with_statement # python2.5 | |
| """ | |
| Project root holds virtual environment | |
| """ | |
| from fabric.api import * | |
| import os.path | |
| # globals | |
| env.project_name = 'myproject' |
This file contains hidden or 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 random import choice | |
| MALE_NAMES_FILE = 'dist.male.first' | |
| FEMALE_NAMES_FILE = 'dist.female.first' | |
| LAST_NAMES_FILE = 'dist.all.last' | |
| if __name__ == '__main__': | |
| MALE_NAMES = list(line.split()[0] for line in open(MALE_NAMES_FILE)) | |
| FEMALE_NAMES = list(line.split()[0] for line in open(FEMALE_NAMES_FILE)) | |
| LAST_NAMES = list(line.split()[0] for line in open(LAST_NAMES_FILE)) |
This file contains hidden or 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.httpserver | |
| import tornado.ioloop | |
| import tornado.options | |
| import tornado.web | |
| import tornado.wsgi | |
| from tornado.options import define, options | |
| define("port", default=8888, help="run on the given port", type=int) |
This file contains hidden or 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 -*- | |
| def getitem(l, index, default=None): | |
| """Returns value of index or default""" | |
| try: | |
| return l[index] | |
| except IndexError: | |
| return default |
This file contains hidden or 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 | |
| # Needs php and java in executable path | |
| B64=""" | |
| UEsDBBQAAAAIAIVyUjx/yWgsbQIAAP0CAAAHABwAcHJvYmxlbVVUCQADeTB9S3ow | |
| fUt1eAsAAQToAwAABOgDAAAdUsmumlAA3fcrGtNFX1zABblgXm2jOACXSRBEY9Jc | |
| 5knmSb6+vi7OkJyzO+fXnx8T6W4WrB3LbiuOBxXMfNRNW8Wn9NipMa4QbVv8MQVL | |
| 05STYRfqADEysKpWFm/3mViqu5EtXlzGPVl6zauMly7vUNt3S9ji1LESwdn63jCN | |
| DZkNHrzCc78lb8/mucZtFFM45ckrs1XnmtOYo34WENfnXkzC9vQ6s3sJEpCifalp | |
| BtvFDjI50bJunpHhegTuhAKuKsh49uGhN9tXPJpkNxknpCaHjgoxivp4MNg4YQSG | |
| V+K8IXs3KvSzK2IcaJOxvWny89ztEn66vIpYcNpw1jnkr7CplWUCGGNneZ0Y3mdK |
This file contains hidden or 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 smtplib | |
| gmail_account = 'darkrho@gmail.com' | |
| gmail_pass = 'misuperpass' | |
| to_emails = ['darkrho@gmail.com'] | |
| message = """From: %s | |
| To: %s | |
| Subject: python rulz! |
This file contains hidden or 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
| var tcp = require('tcp'); | |
| var sys = require('sys'); | |
| var count = 0; | |
| var connected_callback = function(conn, name) { | |
| return function() { | |
| count++; | |
| sys.debug("Connected " + name); | |
| conn.send("GET / HTTP/1.1\r\n"); |
This file contains hidden or 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
| var sys = require('sys'), | |
| http = require('http'), | |
| b64 = require('./base64'), | |
| query = require('querystring') | |
| // Creates a streaming connection with twitter, and pushes any incoming | |
| // statuses to a tweet event. | |
| var TwitterNode = exports.TwitterNode = function(options) { | |
| if(!options) options = {} | |
| this.port = options.port || 80 |
This file contains hidden or 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
| var TwitterNode = require('./lib').TwitterNode; | |
| var sys = require('sys'); | |
| var twit = new TwitterNode({ | |
| user: 'tuitersbolivia' | |
| , password: 'asdf' | |
| }); | |