I hereby claim:
- I am pbdeuchler on github.
- I am pbdeuchler (https://keybase.io/pbdeuchler) on keybase.
- I have a public key whose fingerprint is 479B FD51 D7AC 441D 0439 06CD 44BD 3E79 6C93 5180
To claim this, I am signing this object:
#!/bin/bash -eu | |
# Run command: PROJECT_NAME=test RW_PASSWORD=test HOSTNAME=127.0.0.1 ./psql_bootstrap | |
psql -h $HOSTNAME --username=postgres -c 'DROP DATABASE IF EXISTS '"${PROJECT_NAME}"';' | |
psql -h $HOSTNAME --username=postgres -c 'DROP USER IF EXISTS '"${PROJECT_NAME}"'_rw;' | |
psql -h $HOSTNAME --username=postgres -c 'CREATE DATABASE '"${PROJECT_NAME}"';' | |
psql -h $HOSTNAME --username=postgres -c 'CREATE USER '"${PROJECT_NAME}"'_rw WITH PASSWORD '"'${RW_PASSWORD}'"';' | |
psql -h $HOSTNAME --username=postgres -c 'GRANT ALL PRIVILEGES ON DATABASE '"${PROJECT_NAME}"' TO '"${PROJECT_NAME}"'_rw;' |
I hereby claim:
To claim this, I am signing this object:
def adaptive_resize(img, size=None): #img is a PIL/Pillow Image object, size is a tuple of desired dimensions | |
if size is not None: # resize image | |
if size[0] != size[1]: | |
raise Exception("Provided target dimensions must be equal") | |
smallest_side = min(img.size[0], img.size[1]) | |
if size[0] < smallest_side: # make sure we actually need to resize | |
resize_ratio = float(size[0]) / float(smallest_side) | |
resize_x = int(math.floor(img.size[0] * resize_ratio)) | |
resize_y = int(math.floor(img.size[1] * resize_ratio)) | |
img = img.resize((resize_x, resize_y)) |
package main | |
import ( | |
"fmt" | |
"strconv" | |
"reflect" | |
) | |
type mapFunc func(interface{}) (interface{}) |
def read_only_processor(request): | |
if read_only_flag(): | |
if request.method in ['GET', 'HEAD']: | |
return { | |
'read_only': True, | |
'error_message': 'Sorry, this site is read only right now!" | |
} | |
else: | |
#return a "Read only" response | |
else: |
import shelve | |
import os | |
import sys | |
#Global vars | |
SHELF = os.getcwd() + '/' +'store' #variable for db name | |
LOC = os.getcwd() + '/files/' #variable for corpus location (os.getcwd() gets the current directory) | |
write = sys.stdout.write #For progress bar | |
db = {} |
#!/usr/bin/python -tt | |
''' | |
Didn't you hear? The bird is the word! | |
@author: Philip Deuchler | |
@version: 0.2 Beta | |
''' | |
import urllib2 | |
import json | |
import web |
{ | |
"number": "3", | |
"body": "i feel pretty", | |
"author": "voxeobob", | |
"chat": "Voxeo Engineering", | |
"time": "1309211072" | |
} |
{ | |
"name": "test", | |
"ip": "172.16.160.101", | |
"port": "8080", | |
"protocol": "rest", | |
"version": "0.2" | |
"rules": { | |
"1": [ | |
"string", | |
"chatname" |
import web | |
import json | |
from mimerender import mimerender | |
#Render statements | |
render_xml = lambda message: '<message>%s</message>' % message | |
render_json = lambda **args: json.dumps(args) | |
render_html = lambda message: '<html><body>%s</body></html>' % message | |
render_txt = lambda message: message |