Skip to content

Instantly share code, notes, and snippets.

@leesmith
leesmith / URLs from routes
Created March 13, 2011 19:58
Rails one-liner to get URLs from rake routes
# http://trevmex.com/post/3822870892/rails-one-liner-to-get-urls-from-rake-routes
rake routes | sed -e "1d" -e "s,^[^/]*,,g" | awk '{print $1}' | sort | uniq
@leesmith
leesmith / pgsql-csv-dump.txt
Created November 1, 2011 18:43
Dump postgresql table into csv file
COPY (SELECT foo,bar FROM whatever) TO '/tmp/dump.csv' WITH CSV HEADER;
@leesmith
leesmith / regex.txt
Created November 19, 2011 03:54
Regex cheatsheet
regex characters:
.
any character except newline
[ ]
any single character of set
[^ ]
any single character NOT of set
*
0 or more previous regular expression
*?
@leesmith
leesmith / commit-message-syntax.txt
Created December 31, 2011 06:05
Pivotal Tracker post-commit message syntax
https://www.pivotaltracker.com/help/api?version=v3#github_hooks
https://www.pivotaltracker.com/help/api?version=v3#scm_post_commit_message_syntax
SCM Post-Commit Message Syntax
To associate an SCM commit with a specific Tracker story, you must include a special syntax in the commit message to indicate one or more story IDs and (optionally) a state change for the story. Your commit message should have square brackets containing a hash mark followed by the story ID. If a story was not already started (it was in the "not started" state), a commit message will automatically start it. For example, if Scotty uses the following message when committing SCM revision 54321:
[#12345677 #12345678] Diverting power from warp drive to torpedoes.
@leesmith
leesmith / gist:2307505
Last active October 2, 2015 19:48
OSX software
Alfred http://www.alfredapp.com/
Shiftit http://code.google.com/p/shiftit/
Spectacle http://spectacleapp.com/
Adium http://adium.im/
Dropbox https://www.dropbox.com/
VMware Fusion http://www.vmware.com/products/fusion/overview.html
Teleport http://abyssoft.com/software/teleport/
TextWrangler http://www.barebones.com/products/textwrangler/
Skype http://www.skype.com/
iTerm2 http://www.iterm2.com/
@leesmith
leesmith / psql.txt
Created April 17, 2012 02:54
Ubuntu postgresql notes
# install database server
apt-get install postgresql libpq-dev
# install postgresql gem
gem install pg
# create postgres (super)user
createuser --superuser lsmith -U postgres
# change postgres user password
@leesmith
leesmith / openssl.txt
Created May 3, 2012 15:52
Password generation with openssl
openssl rand -base64 6
openssl rand -hex 4
openssl rand -base64 8 |md5 |head -c8;echo
date |md5 | head -c8; echo
ping -c 1 yahoo.com |md5 | head -c8; echo
@leesmith
leesmith / geokitr.rb
Created May 3, 2012 18:47
Basic geokit geocoding
#!/usr/bin/env ruby
require 'rubygems'
require 'geokit'
require 'csv'
Geokit::Geocoders::google = 'your_key'
places = CSV.read('places.csv', headers: true)
@leesmith
leesmith / setup.md
Created May 16, 2012 00:27
Ruby on Rails development setup on Ubuntu 12.04 (vim, git, rbenv)

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

@leesmith
leesmith / notes.txt
Created June 20, 2012 14:49
wkhtmltopdf EY install notes
cd /data/regions_brandworks/shared
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
tar xfj wkhtmltopdf-0.9.9-static-i386.tar.bz2
sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf