I hereby claim:
- I am cshoe on github.
- I am cshoe (https://keybase.io/cshoe) on keybase.
- I have a public key whose fingerprint is C6FD 526A 4254 CC42 2427 0747 0862 C043 DAD3 9ACC
To claim this, I am signing this object:
FROM ubuntu:12.04 | |
MAINTAINER Chris Schomaker <schomaker.c@gmail.com> | |
# add salt repository | |
RUN sudo apt-get update | |
RUN sudo apt-get install -y python-software-properties | |
RUN sudo add-apt-repository -y ppa:saltstack/salt | |
RUN sudo apt-get update |
import sys | |
from xml.etree import ElementTree | |
from jinja2 import Template | |
template_string = """{\\rtf1\\ansi\\ansicpg1252\cocoartf1265\cocoasubrtf190 | |
{\\fonttbl\\f0\fswiss\\fcharset0 ArialMT;\\f1\\froman\\fcharset0 Times-Roman;} | |
{\colortbl;\\red255\green255\\blue255;} |
I hereby claim:
To claim this, I am signing this object:
# As mentioned, this is a bit verbose but I like the separation of concerns. | |
# Basically, you have two functions -- one that does meaningful work and | |
# another that just serves as the "glue" to connect the Django signal | |
# infrastructure to your function. | |
from django.dispatch import receiver | |
@receiver | |
def glue_funtion(sender, **kwargs): | |
""" |
importer = ImpImporter('full/path/to/module/dir/') | |
loader = importer.find_module(<module name without .py>) | |
m = loader.load_module(<module name without .py>) |
I hereby claim:
To claim this, I am signing this object:
from .local import * | |
DEBUG = True | |
TEMPLATE_DEBUG = False | |
DJANGO_DEBUG_TOOLBAR = False | |
if DJANGO_DEBUG_TOOLBAR: | |
def extend_tuple(tuple_to_modify, *args): | |
# Use this function to simply add elements to an existing tuple | |
return tuple([item for item in tuple_to_modify] + [arg for arg in args]) |
import json | |
import oauth2 | |
# FILL THESE OUT | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
# has to be an access token, not a request token | |
TOKEN = '' |
def first_function(return_value): | |
"""Returns `return_value`. | |
""" | |
print 'Running FIRST function' | |
return return_value | |
def second_function(return_value): | |
"""Returns `return_value`. |
def main(): | |
# this is the dict that we want to trim down. | |
# basically we want to collapse `foo` into a list for a common `id` | |
bloated_map = [{'foo': 2, 'id': 160}, | |
{'foo': 314, 'id': 160}, | |
{'foo': 314, 'id': 161}, | |
{'foo': 2, 'id': 161}] | |
# this gives us a list of unique ids | |
id_list = set([x['id'] for x in bloated_map]) |