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
print "this is a gist meant to test python API calls for comments" |
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 | |
requirements_txt''' | |
oauth==1.0.1 | |
oauthlib==0.7.2 | |
requests==2.6.0 | |
requests-oauthlib==0.4.2 | |
''' | |
import os,sys,json,requests | |
#import twitter | |
from pprint import pprint |
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 os | |
class untrue(object): | |
""" | |
new type of object to comunicate untruth | |
""" | |
def __nonzero__(_): return False | |
pass | |
def force(thunk): | |
""" | |
if you pass this a thunk, it will evaluate it and eat the errors. |
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
# Re-add sslwrap to Python 2.7.9 | |
import inspect | |
__ssl__ = __import__('ssl') | |
try: | |
_ssl = __ssl__._ssl | |
except AttributeError: | |
_ssl = __ssl__._ssl2 | |
pass |
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 traceback as tb, gevent | |
from concurrent.futures import Future | |
in_flight = [0] | |
in_flight_max = 100 | |
Q = [] | |
def spawn_query(fn,future,*a,**kw): | |
def wrapper(): | |
try: |
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 docker build -f | |
FROM ubuntu | |
MAINTAINER Joel Ward <jmward@gmail.com> | |
RUN apt-get -y -qq install python wget git | |
RUN cd /opt && \ | |
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-x64.tar.gz && \ | |
tar -xvf node-v0.10.28-linux-x64.tar.gz && \ | |
mv node-v0.10.28-linux-x64 node && \ | |
cd /usr/local/bin && \ | |
ln -s /opt/node/bin/* . && \ |
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
alias ll='ls -la' | |
alias run='dock run' | |
alias build='dock build .' | |
alias build2='dock build2' | |
# OSX (Darwin) only | |
if [ "`uname`" == "Darwin" ]; then | |
$(boot2docker shellinit 2>/dev/null) | |
fi |
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 install pyaml | |
-- | |
import sys,yaml | |
yaml.load(open(sys.argv[1])) | |
""" | |
import os.path,yaml | |
from yaml import * | |
root = os.path.curdir | |
def include(loader, node): |
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 sys,jinja2,yamli | |
def main( tmpl_text, data_text ): | |
data = yamli.load( data_text ) | |
tmpl = jinja2.Template( tmpl_text ). | |
f_out.write( tmpl.render( ** data ) ) | |
if __name__=='__main__': main( *sys.argv ) |
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 | |
import os, sys, requests | |
Hostname = sys.argv[1] | |
Username = sys.argv[2] | |
Password = sys.argv[3] | |
AppToken = 'U3dlcUFOQWdFVkVoVWt1cGVjcmVrYXN0ZXFhVGVXckFTV2E1dXN3MzpXMnZBV3JlY2hhUHJlZGFoVVJhZ1VYYWZyQW5hbWVqdQ==' |