Skip to content

Instantly share code, notes, and snippets.

View drewrothstein's full-sized avatar

Drew Rothstein drewrothstein

View GitHub Profile
@drewrothstein
drewrothstein / woof.bash
Last active October 30, 2015 09:10 — forked from msbarry/woof.bash
# Some utilities for sending notifiations to yourself from the command line (mac only).
# Just add them to your ~/.bashrc and fill in these parameters.
# See them all in action: "ugh <long running command> && woof command succeeed || woof command failed"
TWITTER_HANDLE= # twitter handle
EMAIL_ADDRESS= # email address
CELL_EMAIL_ADDRESS= # email address for your cell phone (ie 1234567890@vtext.com)
TERMINAL_APP="com.apple.Terminal" # replace with iterm if you use that
THEME_SONG="~/waiting.mp3" # replace with a path to your theme song
@drewrothstein
drewrothstein / aws_usage.py
Created July 11, 2011 20:39 — forked from rcoup/aws_usage.py
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'

Keybase proof

I hereby claim:

  • I am drewrothstein on github.
  • I am mediocrity (https://keybase.io/mediocrity) on keybase.
  • I have a public key ASC90Pft-Xf3Isng7zulTgCDoeRU2zg1fIA8nTtP55oTggo

To claim this, I am signing this object:

@drewrothstein
drewrothstein / app.yaml
Created March 26, 2017 22:54
PyDev (webapp framework) w/Eclipse
application: simple-bird-mail
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
@drewrothstein
drewrothstein / main.py
Created March 26, 2017 22:56
PyDev (webapp framework) w/Eclipse
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello World!')
app = webapp2.WSGIApplication([('/', MainPage)])
@drewrothstein
drewrothstein / console
Created March 26, 2017 23:00
Flask w/o Eclipse
$ gcloud source repos clone simplebirdmail --project=simple-bird-mail-162703
Cloning into '/Users/drew/src/simplebirdmail'...
remote: Total 112 (delta 34), reused 112 (delta 34)
Receiving objects: 100% (112/112), 29.30 KiB | 0 bytes/s, done.
Resolving deltas: 100% (34/34), done.
Project [simple-bird-mail-162703] repository [simplebirdmail] was cloned to [/Users/drew/src/simplebirdmail].
@drewrothstein
drewrothstein / console
Created March 26, 2017 23:03
Flask w/o Eclipse
$ cd simplebirdmail
$ cp -r ~/Downloads/gcp-python-samples/appengine/standard/flask/tutorial .
@drewrothstein
drewrothstein / console
Created March 26, 2017 23:06
Flask w/o Eclipse
$ pip install -t lib -r requirements.txt
Collecting Flask==0.12 (from -r requirements.txt (line 1))
Using cached Flask-0.12-py2.py3-none-any.whl
Collecting click>=2.0 (from Flask==0.12->-r requirements.txt (line 1))
Using cached click-6.7-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from Flask==0.12->-r requirements.txt (line 1))
Using cached Werkzeug-0.12.1-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from Flask==0.12->-r requirements.txt (line 1))
Using cached Jinja2-2.9.5-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask==0.12->-r requirements.txt (line 1))
@drewrothstein
drewrothstein / console
Created March 26, 2017 23:07
Flask w/o Eclipse
$ dev_appserver.py app.yaml
INFO 2017-03-26 23:07:25,346 devappserver2.py:764] Skipping SDK update check.
INFO 2017-03-26 23:07:25,405 api_server.py:268] Starting API server at: http://localhost:59539
INFO 2017-03-26 23:07:25,412 dispatcher.py:199] Starting module "default" running at: http://localhost:8080
INFO 2017-03-26 23:07:25,417 admin_server.py:116] Starting admin server at: http://localhost:8000
@drewrothstein
drewrothstein / form.html
Created March 26, 2017 23:12
Frontend Design Setup
<html>
<head>
<title>Simple Bird Mail</title>
<link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>
<div id="container">
<div class="pagetitle">
<h1>Simple Bird Mail</h1>
</div>