Skip to content

Instantly share code, notes, and snippets.

View 51_second_query.txt
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",
@noverloop
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
fi
# alias for quick DNS cache flushing
alias fc='sudo dscacheutil -flushcache'
# enable the git bash completion commands
#source ~/.git-completion
@noverloop
noverloop / gist:4148748
Created Nov 26, 2012
Postgresql and Postgis on mountain lion
View gist:4148748
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 / 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
noverloop / Procfile
Created Mar 26, 2012
modifications needed to act as buffering reverse proxy on heroku
View Procfile
web: ruby config.ru $PORT
worker: bundle exec thin start -R app_name.ru --socket tmp/thin.sock -e production