Skip to content

Instantly share code, notes, and snippets.

View 51_second_query.txt
curl -X GET '' -d '{
"head wraps for women",
"hair ornament",
noverloop / bash_profile
Created Jan 10, 2013
My custom console prompt
View bash_profile
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
# alias for quick DNS cache flushing
alias fc='sudo dscacheutil -flushcache'
# enable the git bash completion commands
#source ~/.git-completion
noverloop / gist:4148748
Created Nov 26, 2012
Postgresql and Postgis on mountain lion
View gist:4148748
When installing on mountain lion:
brew install postgresql --without-ossp-uuid
initd /usr/local/var/postgres
mkdir /var/pgsql_socket
chown <user> /var/pgsql_socket
edit /usr/local/var/postgres/postgresql.conf
set unix_socket_directory to /var/pgsql_socket
noverloop / gist:2318592
Created Apr 6, 2012
Sendmail Callback, deactivate users who bounce
View gist:2318592
class MailController < ApplicationController
layout "none"
# the sendgrid notification callback.
def notification
puts params
u = User.where(:email => params["email"]).first
if params["event"] == 'bounce'
u.deactivate! "an invalid email address has been provided"
elsif params["event"] == 'spamreport'
u.deactivate! "a spam report was filed from your email address"
noverloop / Procfile
Created Mar 26, 2012
modifications needed to act as buffering reverse proxy on heroku
View Procfile
web: ruby $PORT
worker: bundle exec thin start -R --socket tmp/thin.sock -e production