Skip to content

Instantly share code, notes, and snippets.

View hcwiley's full-sized avatar

H. Cole Wiley hcwiley

View GitHub Profile
@hcwiley
hcwiley / rounder5px.css
Created February 21, 2012 03:38
rounded corners css
.rounded{
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
}
# With this setup, your OAuth URLs will be:
Request Token URL: /oauth/request_token/
User Authorization URL: /oauth/authorize/, using HTTP GET.
Access Token URL: /oauth/access_token/
@hcwiley
hcwiley / $init
Created April 29, 2012 15:16
jQuery init and resize setup
jQuery.event.add(window, 'resize', resize);
jQuery.event.add(window, 'load', init);
@hcwiley
hcwiley / add
Created June 1, 2012 21:37
add to mongodb
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"title":"boo","description":"hahaha"}' -X POST http://localhost:8080/api/lesson
@hcwiley
hcwiley / .vimrc
Created June 9, 2012 07:05
my vimrc that i like and works
""" Vundle """""""""""""""""""""""""""""""""""""""""""""
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
@hcwiley
hcwiley / .bash_profile
Created July 10, 2012 23:43
this is my bash_profile
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
#test -r /sw/bin/init.sh && . /sw/bin/init.sh
export PATH=/usr/local/mysql/bin:$PATH
export PATH=/Library/PostgreSQL/9.1/bin:$PATH
PYTHONPATH="/usr/local/lib":$PYTHONPATH
export PYTHONPATH
@hcwiley
hcwiley / README.md
Last active December 10, 2015 15:39
makes routes for ui and api for models based off a baseModel.
@hcwiley
hcwiley / local_settings.py
Created January 12, 2013 17:02
my typical local_settings.py file
MEDIA_ROOT = '/Users/hcwiley/github/heartbucket/heartbucket.com/static'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'heartbucket', # Or path to database file if using sqlite3.
'USER': 'django', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
@hcwiley
hcwiley / ledFormat.py
Created February 5, 2013 17:33
usage: $ python ledFormat.py 110100111010
import sys
str = sys.argv[1]
i = 0
out = ""
for c in str:
i += 1
out += c
if i % 4 == 0:
out += "\n"
@hcwiley
hcwiley / makeRoutes.py
Created April 16, 2013 18:55
works with https://github.com/jwietelmann/express3_boilerplate to build out routes based on a baseModel
import os, sys
models = ['foo', 'bar', 'fooBar']
baseModel = 'baseModel'
os.chdir('routes/ui')
extension = ".js"
for model in models:
f = open("%ss%s" % (baseModel, extension ))
newLines = []
for line in f.readlines():
line = line.replace("%s" % baseModel, "%s" % model)