Skip to content

Instantly share code, notes, and snippets.

@deanohyeah
deanohyeah / gist:5223157
Created March 22, 2013 17:29
css for balance bugdet
@font-face{font-family:'icomoon';src:url("http://seattletimes.com/css/2013/fonts/icomoon.eot");src:url("http://seattletimes.com/css/2013/fonts/icomoon.eot?#iefix") format("embedded-opentype"),url("http://seattletimes.com/css/2013/fonts/icomoon.svg#icomoon") format("svg"),url("http://seattletimes.com/css/2013/fonts/icomoon.woff") format("woff"),url("http://seattletimes.com/css/2013/fonts/icomoon.ttf") format("truetype");font-weight:normal;font-style:normal}[data-icon],[class^="icon-"]:before,.icon-square:before,.Internal:before,.Related_story:before,.icon-external:before,.External:before,.icon-photo:before,.Photograph:before,.Photo_Gallery:before,.icon-print:before,.Print:before,.icon-video:before,.Video:before,.King_Video:before,.AP_video:before,.Graphic_Animation:before,.icon-chart:before,.icon_character{font-family:'icomoon';speak:none;font-weight:normal;-webkit-font-smoothing:antialiased;color:#bc5c23;content:attr(data-icon)}[class^="icon-"]:before,.icon-square:before,.Internal:before,.Related_story:before
@deanohyeah
deanohyeah / .shp to geojson
Created April 29, 2013 23:48
Convert to shape file to geojson
fix projection if needed
ogr2ogr -t_srs EPSG:4326 output.shp input.shp
convert to geojson
ogr2ogr -f GeoJSON output.shp input.shp
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.postgresql</string>
<key>ProgramArguments</key>
<array>
@deanohyeah
deanohyeah / Start psql
Created June 19, 2013 17:12
Starts homebrew version of postgres
pg_ctl -D /usr/local/var/postgres9 -l /usr/local/var/postgres9/server.log start
dropdb <name>
createdb <name>
django-admin.py syncdb
- loads db
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U dkramer -d migrate_test ~/Desktop/b009.dump
fake it
dropdb <name>
createdb <name>
django-admin.py syncdb
## loads db
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U dkramer -d migrate_test ~/Desktop/b009.dump
fake it
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(name):
text = name['name']
sortKey = [ atoi(c) for c in re.split('(\d+)', text) ]
try:
return sortKey[1],sortKey[0],sortKey[3]
except:
Merge results into master
git push <app remote> master
heroku run bash --app <app-name>
python seatimes/manage.py syncdb
python seatimes/manage.py migrate people 0001 --fake
python seatimes/manage.py migrate legislators 0001 --fake
@deanohyeah
deanohyeah / Share code
Last active December 20, 2015 16:29
random sniipets
d
@deanohyeah
deanohyeah / js mediaquery
Created August 22, 2013 23:01
js mediaquery
<script type="text/javascript">
var mediaQuery;
//checks for browser support ie < 10 no support
if(typeof window.matchMedia == 'function'){
mediaQuery = window.matchMedia("(max-width: 767px)").matches;
}else{
mediaQuery = false;
}
if (!mediaQuery) {