Skip to content

Instantly share code, notes, and snippets.

@noverloop
noverloop / Procfile
Created March 26, 2012 10:03
modifications needed to act as buffering reverse proxy on heroku
web: ruby config.ru $PORT
worker: bundle exec thin start -R app_name.ru --socket tmp/thin.sock -e production
@noverloop
noverloop / gist:2318592
Created April 6, 2012 10:01
Sendmail Callback, deactivate users who bounce
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
noverloop / gist:4148748
Created November 26, 2012 15:20
Postgresql and Postgis on mountain lion
When installing on mountain lion:
installation:
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
noverloop / bash_profile
Created January 10, 2013 11:30
My custom console prompt
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# alias for quick DNS cache flushing
alias fc='sudo dscacheutil -flushcache'
# enable the git bash completion commands
#source ~/.git-completion
curl -X GET '23.21.224.90:9200/mentions/mention/_search?search_type=count&size=10&pretty' -d '{
"query":{
"constant_score":{
"filter":{
"and":[
{
"terms":{
"keyword":[
"head wraps for women",
"hair ornament",