Skip to content

Instantly share code, notes, and snippets.

@ian-bartholomew
ian-bartholomew / es-percolate-test
Last active August 29, 2015 14:13
Elasticsearch percolate test
- create -
curl -XPUT 'localhost:9200/my-index/my-type/1' -d '{"title" : "Coffee percolator", "body" : "A coffee percolator is a type of ..."}'
- search -
curl -XGET 'localhost:9200/my-index/_search' -d '{"query" : {"match" : {"body" : "coffee"}}}'
- get all -
curl -XGET 'localhost:9200/my-index/_search?pretty=true'
- Register a query -
@ian-bartholomew
ian-bartholomew / gist:8922225
Created February 10, 2014 19:13
Git branch in bash prompt
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
function proml {
local BLUE="\[\033[0;34m\]"