Skip to content

Instantly share code, notes, and snippets.

View spulec's full-sized avatar

Steve Pulec spulec

View GitHub Profile
@spulec
spulec / gist:8285482
Created January 6, 2014 16:36
Auto activate virtualenvs in new terminal windows.
# If we are in a Development folder, we're probably in a virtual env. Try to activate it based on our CWD.
IN=$PWD
if [[ "$IN" == */Development/* ]]
then
arrIN=(${IN//// })
# This assumes Development is the third token and your project directory is the fourth
workon ${arrIN[3]}
fi
@spulec
spulec / flask_moto.py
Created March 14, 2015 23:41
flask moto test
from flask import Flask
app = Flask(__name__)
import boto
from moto import mock_s3
@app.route("/")
def hello():
conn = boto.connect_s3('the_key', 'the_secret')
bucket = conn.create_bucket('mybucket')