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
- hosts: localhost | |
remote_user: dirn | |
vars: | |
ansible: ~/.ansible | |
dotfiles: "{{ ansible }}/dotfiles" | |
rc_file: ~/.extra | |
pyenv: /Users/{{ ansible_ssh_user }}/.pyenv | |
python_version: 3.4.3 | |
python_versions: [2.6.9, 2.7.9, 3.3.6, 3.4.3, pypy-2.5.0, pypy3-2.4.0] |
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
class AliasedDict(dict): | |
def __init__(self, mapping): | |
self.mapping = mapping | |
def __getitem__(self, key): | |
if key in self.mapping: | |
key = self.mapping[key] | |
return super().__getitem__(key) | |
def __setitem__(self, key, value): |
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
"""The PyGotham home page.""" | |
from flask import Blueprint, render_template | |
from pygotham.news import get_active | |
from pygotham.sponsors import get_accepted | |
__all__ = ('blueprint',) | |
blueprint = Blueprint( |
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
- name: PyGotham | |
docker: | |
name: web | |
image: python:3.4.3 | |
pull: always | |
state: reloaded | |
env: | |
PYTHONUNBUFFERED: 1 | |
link: | |
- "db:db" |
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 ubuntu:14.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
VOLUME ["/data/devpi"] | |
EXPOSE 3141 | |
RUN apt-get update -q && apt-get install -y netbase python | |
ADD https://bootstrap.pypa.io/get-pip.py /get-pip.py | |
RUN python /get-pip.py |
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 csv | |
from bs4 import BeautifulSoup | |
import requests | |
in_url = 'http://rangers.nhl.com/club/schedule.htm' | |
# in_filename = 'schedule.html' | |
out_filename = 'schedule.csv' | |
resp = requests.get(in_url) |
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
"""Build a script with Switches""" | |
from switches import command, commandline | |
@command | |
def spam(eggs): | |
"""This function prints the value of eggs""" | |
print eggs |
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
# https://devcenter.heroku.com/articles/django-assets | |
heroku labs:enable user-env-compile -a [app_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
{ | |
"color_scheme": "Packages/Tomorrow-Night-Bright.tmTheme", | |
"detect_indentation": false, | |
"ensure_newline_at_eof_on_save": true, | |
"find_selected_text": true, | |
"fold_buttons": false, | |
"folder_exclude_patterns": | |
[ | |
"_build", | |
"__pycache__", |
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 | |
"""Checks for anagrams in stdin. | |
Example: $ curl -sL http://thumb.tk/8Qdr | python anagrams.py | |
""" | |
import itertools | |
import sys |