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
# -*- coding: utf-8 -*- | |
# stdlib | |
from timeit import Timer | |
# Bunch | |
import bunch | |
d = {1:11, 2:22, 3:33} | |
b = bunch.Bunch(d) |
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
# pip | |
from pip.download import unpack_file_url | |
class _DummyLink(object): | |
""" A dummy class for staying consistent with pip's API in certain places | |
below. | |
""" | |
def __init__(self, url): | |
self.url = 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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <cmqc.h> /* MQI */ | |
#include <cmqcfc.h> /* PCF */ | |
#include <cmqbc.h> /* MQAI */ | |
void check_call_result(MQCHAR *, MQLONG , MQLONG ); |
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
# Use it under the Python license | |
import re | |
_uncamelify_re = re.compile(r'((?<=[a-z])[A-Z]|(?<!\A)[A-Z](?=[a-z]))') | |
# Inspired by http://stackoverflow.com/a/9283563 | |
def uncamelify(s, separator='-', elem_func=unicode.lower): | |
""" Converts a CamelCaseName into a more readable one, e.g. | |
will turn ILikeToReadWSDLDocsNotReallyNOPENotMeQ into |
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
[buildout] | |
extends=versions.cfg | |
unzip = true | |
parts = | |
cython-src | |
cython-install | |
gevent_zeromq_patched-src | |
gevent_zeromq_patched-install | |
pyyaml-src |
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
[buildout] | |
versions=versions | |
[versions] | |
anyjson = 0.3.3 | |
apscheduler = 2.0.3 | |
argparse = 1.2.1 | |
boto = 2.6.0 | |
bunch = 1.0.1 | |
bzr = 2.5 |
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
#!/bin/bash | |
# | |
# Taken from https://gist.github.com/josephwecker/2884332 | |
# | |
CURDIR="${BASH_SOURCE[0]}";RL="readlink";([[ `uname -s`=='Darwin' ]] || RL="$RL -f") | |
while([ -h "${CURDIR}" ]) do CURDIR=`$RL "${CURDIR}"`; done | |
N="/dev/null";pushd .>$N;cd `dirname ${CURDIR}`>$N;CURDIR=`pwd`;popd>$N | |
function symlink_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
{ | |
"security": { | |
"name": "my security", | |
"type": "wss", | |
"username": "my user", | |
"password": "my password", | |
}, | |
"outconns": { | |
"my external app": { | |
"type": "soap", |
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
request = {'from':'EUR', 'to':'HRK'} | |
response = get_exchange_rate(request) | |
print(response.rate) | |
# 1 EUR = 7.4680 HRK as of Jun 13, 2013, 5:00PM GMT |
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 django.template.response import TemplateResponse | |
def home(req): | |
# A dictionary of input data read from HTTP GET. If no input was given | |
# we translate from EUR to HRK. | |
to = req.GET.get('to', 'HRK') | |
request = {'from':'EUR', 'to':to} | |
# Pass the dictionary into the client's invoke method along with the name |
OlderNewer