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
"""PEP 302 import hook to caching system path contents. | |
Implements an import hook using a finder and loader class to load Python | |
modules from system paths while caching the path contents. | |
""" | |
from __future__ import print_function | |
import glob | |
import imp | |
import os |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# 64-bit Ubuntu 12.04 LTS | |
config.vm.box = "hashicorp/precise64" |
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
Command line interface tools are the new web framework. In addition to the | |
Python standard library's getopt, optparse and argparse there is a bewildering | |
array of packages available on the Python Packaging Index. Packages like Click, | |
Cliff, Docopt, Invoke all provide different mechanics for creating command line | |
applications. When all you want to do is expose a command line and get back to | |
creating functionality, it’s hard to know which alternative to reach for. | |
This presentation will have two parts, the first half will be a brief survey | |
of popular modules. Strengths, weaknesses and design philosophies will be | |
compared by creating command line processing for the same example program. |
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
$ git remote -v | |
origin [email protected]:aliles-heroku/twoslug.git (fetch) | |
origin [email protected]:aliles-heroku/twoslug.git (push) |
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
$ python run.py markov --length 10 --chain 4 --words 30 | |
ledgeringw | |
fmri | |
blockscrew | |
stickpoolr | |
trudentine | |
shirtlifto | |
northomosi | |
pollusiona | |
aralytechi |
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 flask import Flask | |
import begin | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' | |
@begin.start(env_prefix='WEB_') |
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
"Program execution context" | |
import warnings | |
class SwizzleContext(object): | |
"""Type switching context object base class | |
Supports the context manager protocol to switch the instance from a | |
MutableContext to the protected Context. | |
""" |
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 begin | |
my_formatter = begin.formatters.compose(begin.formatters.RawDescription) | |
@begin.subcommand | |
def sub(): | |
"""Such text | |
Very whitespace | |
So exact | |
""" |
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
"""API endpoint templating using Jinja2. | |
Rendering of Jinja2 templates, with external actions, using Twisted.Web. | |
Combining external actions for Jinja2 [1] with Twisted's deferreds inside the | |
Twisted's web framework. Jinja2 templates are iteratively processed [2] to | |
render an API response [3]. The template prepares, executes and formats the | |
response from an HTTP request. | |
When run, the application looks up an email address provided as a GET paramater |
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
"""Rendering of Jinja2 templates, with external actions, using Twisted. | |
Combines external actions for Jinja2 [1] with Twisted's deferreds for | |
cooperative iterator consumption [2] to render template. The template prepares, | |
executes and formats the response from an HTTP request. | |
[1] https://gist.github.com/aliles/8417271 | |
[2] https://gist.github.com/aliles/8454244 | |
""" | |
import os |
NewerOlder