Skip to content

Instantly share code, notes, and snippets.

View jsplink's full-sized avatar
🖤

John jsplink

🖤
  • San Francisco, CA
View GitHub Profile
import os
import psycopg2
import psycopg2.extras
from psycopg2 import ProgrammingError
from psycopg2 import OperationalError
from controllers.settings import test_connection as TEST_CONN
from controllers.settings import connection as CONN
from controllers.settings import cursor_composites
@jsplink
jsplink / gist:6e39f9e2fc07af4221e9
Created September 30, 2014 16:00
the kitchen sink
@login_required
@csrf_exemp
def stamp_detail(self, request):
# (N) login adapted from stamps.views.observe
# grab the stamp from the DB
GRID_SHAPES = [(4, 5), (7, 9), (13, 17)]
try:
request.META['HTTP_USER_AGENT'] = request.GET.get('uagent')
apicall = get_stamp(
@jsplink
jsplink / gist:7b6bd84081c481714dcb
Last active August 29, 2015 14:17
.bash_profile
# Specifically for MaxOSX
# ==================
# TERMINAL CONFIGS
# ==================
# color scheme
PS1='\[\033[0;32m\]\u@\h\[\033[0;36m\] \w\[\033[00m\]: '
# bash history modifications
shopt -s histappend
@jsplink
jsplink / postmkvirtualenv
Last active August 29, 2015 14:17
postmkvirtualenv
#!/bin/bash
# This hook is sourced after a new virtualenv is activated.
#rvm ruby do rvm gemset create ${PROJECT_RVM_ENV};
ruby do rvm gemset create ${PROJECT_RVM_ENV};
pip install nodeenv;
nodeenv -p;
mkdir ~/projects/${PROJECT_NAME}
touch ~/projects/${PROJECT_NAME}/todo.stml
cat > ~/projects/${PROJECT_NAME}/${PROJECT_RVM_ENV}.sublime-project <<DELIM
{
@jsplink
jsplink / bash_profile
Last active August 29, 2015 14:17
bash_profile
# Specifically for MaxOSX
# ==================
# TERMINAL CONFIGS
# ==================
# color scheme
PS1='\[\033[0;32m\]\u@\h\[\033[0;36m\] \w\[\033[00m\]: '
# bash history modifications
shopt -s histappend
@jsplink
jsplink / postactivate
Last active August 29, 2015 14:17
postactivate
#!/bin/bash
# This hook is sourced after every virtualenv is activated.
export PROJECT_NAME=${VIRTUAL_ENV#$WORKON_HOME/};
export PROJECT_PATH=/Users/${USER}/repos/${PROJECT_NAME};
export PROJECT_RVM_ENV=`echo $PROJECT_NAME | sed 's,[/-_],,g'`;
# override path to...
# (1) setup rvm and
# (2) pyenv and
# (3) virtualenv binaries
@jsplink
jsplink / postdeactivate
Created March 26, 2015 22:39
postdeactivate
#!/bin/bash
# This hook is sourced after every virtualenv is deactivated.
source ~/.bash_profile;
@jsplink
jsplink / gist:61515442d19025b3d9d0
Last active October 12, 2015 17:51
sublime user config
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"copy_with_empty_selection": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
Better CoffeeScript
Bootstrap 3 Jade Snippets # (T) document, not used
Bootstrap 3 Snippets # (T) use more
Color Highlighter
Cucumber
Emmet
Handlebars
JSON Reindent # (T) remove, using npm install -g prettyjson
Javascript Beautity # (T) remove
JsFormat # (T) remove
@jsplink
jsplink / package.json
Last active August 29, 2015 14:18
project startup guide
# Assumption: virtualenv hooks are all setup
PROJECT_NAME = 'obimod/myproject'
mkvirtualenv ${PROJECT_NAME}
pip install nodeenv
nodeenv -p
# TODO: Add in package.json now
npm install -g
npm link