Skip to content

Instantly share code, notes, and snippets.

@jprjr
jprjr / Dockerfile
Created November 26, 2013 23:09
Setting up pyenv in docker
FROM tianon/centos-null:5.9
RUN rpm -i http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
RUN yum -y update
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN useradd -m python_user
RUN ln -s /proc/self/fd /dev/fd
@tsoporan
tsoporan / gist:2764350
Created May 21, 2012 20:08
Twitter Access Token /w Flask & Rauth
from flask import Flask, request, redirect, url_for
from rauth.service import OAuth1Service
twitter = OAuth1Service(
name='twitter',
consumer_key='TWITTER KEY',
consumer_secret='TWITTER SECRET',
request_token_url = 'https://api.twitter.com/oauth/request_token',
access_token_url = 'https://api.twitter.com/oauth/access_token',
authorize_url = 'https://api.twitter.com/oauth/authorize',
@jleclanche
jleclanche / weather.py
Created May 13, 2012 19:05
Quick python weather script using Google's Weather API
#!/usr/bin/env python
# encoding: utf-8
import sys
from argparse import ArgumentParser
from xml.dom import minidom
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError:
@lrvick
lrvick / github_flask.py
Created April 26, 2012 06:47
Github API access with Flask and rauth
from flask import Flask, request, redirect, url_for
from rauth.service import OAuth1Service, OAuth2Service
github = OAuth2Service(
name='github',
consumer_key='GITHUB_CONSUMER_KEY',
consumer_secret='GITHUB_CONSUMER_SECRET',
access_token_url='https://github.com/login/oauth/access_token',
authorize_url='https://github.com/login/oauth/authorize',
)