Day job: Technologist @ Local Projects
Favorite Python project: Requests
Favorite Conference: Eyeo Festival
Python Experience Level: Intermediate
Day job: Technologist @ Local Projects
Favorite Python project: Requests
Favorite Conference: Eyeo Festival
Python Experience Level: Intermediate
| import unittest | |
| from flask import Flask, render_template | |
| from flaskext.testing import TestCase, Twill | |
| TWILL_ENABLED = True | |
| DEBUG = True | |
| SECRET_KEY = 'secret' | |
| def create_app(): | |
| app = Flask(__name__) |
| from werkzeug import url_decode | |
| class HTTPMethodOverrideMiddleware(object): | |
| def __init__(self, app): | |
| self.app = app | |
| def __call__(self, environ, start_response): | |
| if 'METHOD_OVERRIDE' in environ.get('QUERY_STRING', ''): | |
| args = url_decode(environ['QUERY_STRING']) |
| import logging | |
| import types | |
| from boto.ses import SESConnection | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| from email.utils import COMMASPACE | |
| class SESHandler(logging.Handler): | |
| """ | |
| A handler class which sends an email using Amazon SES. |
| ; Sample supervisor config file. | |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; (the path to the socket file) | |
| ;chmod=0700 ; sockef file mode (default 0700) | |
| ;chown=nobody:nogroup ; socket file uid:gid owner | |
| ;username=user ; (default is no username (open server)) | |
| ;password=123 ; (default is no password (open server)) | |
| ;[inet_http_server] ; inet (TCP) server disabled by default |
| os | |
| from flask_extended import Flask | |
| app = Flask(__name__) | |
| app.config.from_yaml(os.join(app.root_path, 'config.yml')) |
| # Supervisord auto-start | |
| # | |
| # description: Auto-starts supervisord | |
| # processname: supervisord | |
| # pidfile: /var/run/supervisord.pid | |
| PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
| NAME=supervisord | |
| DESC="supervisod is a system for controlling process state" | |
| SUPERVISORD=/usr/local/bin/supervisord |
| --- | |
| - hosts: testing | |
| user: ubuntu | |
| sudo: True | |
| vars_files: | |
| - software/nginx/vars/default.yml | |
| tasks: |
| #target photoshop | |
| main (); | |
| function cloneRectangle(rect) { | |
| return { x:rect.x, y:rect.y, width:rect.width, height:rect.height }; | |
| } | |
| function rectangle(x, y, width, height) { | |
| return { x:x, y:y, width:width, height:height }; |
| Vagrant::Config.run do |vagrant| | |
| vagrant.vm.define :vm1 do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :hostonly, "192.168.0.80" | |
| config.vm.host_name = 'rabbit1' | |
| config.vm.provision :chef_solo do |chef| | |
| chef.add_recipe "apt" | |
| chef.add_recipe "hostsfile" |