Skip to content

Instantly share code, notes, and snippets.

View skyler's full-sized avatar

Skyler Slade skyler

  • Constant Contact
  • Gainesville, FL
View GitHub Profile
@skyler
skyler / run.py
Created September 18, 2012 22:37
run.py
from werkzeug import SharedDataMiddleware
import os
import logging
from panel import app
# Serve static files through Flask during development
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
'/': os.path.join(os.path.dirname(__file__), 'static')
})
server {
listen 80;
server_name www.coefficientinc.com coefficientinc.com;
root /opt/www/coefficient/static;
try_files $uri @uwsgi;
location @uwsgi {
include uwsgi_params;
<?php
/**
* JSON server
*/
class JSONServer
{
/**
* @var the service object instance
*/
private $obj;
"""Convenience methods for interacting with the database.
Calling get_db_connection() will return the open database handle.
"""
import psycopg2
from psycopg2.extras import DictConnection
from contextlib import closing
import configure
" Skyler's .vimrc
set nocompatible " be iMproved!
filetype plugin indent on " plugin and indent are required for Pathogen
syntax on
colorscheme jellybeans
" Pathogen
call pathogen#infect()
{
"AK": "Alaska",
"AL": "Alabama",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@skyler
skyler / runinenv.sh
Created November 5, 2012 17:13 — forked from parente/runinenv.sh
run a command in virtualenv, useful for supervisord
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"
#!/bin/bash
S3_ACCESS_KEY=XXX
FILENAME=$(date +"coefficient_%Y_%m_%d.pg")
PATH=/home/skyler/
echo "dumping database..."
/usr/bin/pg_dump coefficient --file $PATH$FILENAME
echo "uploading backup to S3..."
"tickets.py" 20L, 502C written
from pprint import pprint
num_servers = 3
ids = []
gen_how_many = 10000
i = 0
while i < num_servers:
office.announce.out-sick
office.announce.benefits
office.announce.fridge-cleaning
office.announce.general
developers.tech-news
developers.programming
rec.events.orlando
industry-news
in-the-news
product