Skip to content

Instantly share code, notes, and snippets.

@jameskbride
jameskbride / bashrc_ps1_snippet.sh
Created April 13, 2013 14:12
Bash PS1 prompt with git branch info and color.
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]$(__git_ps1 "(%s)")\[\033[00m\]\$ '
@jameskbride
jameskbride / HTTBuilderBinary.groovy
Created September 29, 2012 14:26
HTTPBuilder Binary Response Example
def getBinaryStream(params) {
def data
def http = new HTTPBuilder("http://google.com/baseURI")
http.request(Method.GET, ContentType.BINARY) {req ->
//uri.path = "/a/relative/path/here"
uri.port = "8080"
uri.query = [userName: "user", password:"password"]
headers.'User-Agent' = 'Mozilla/5.0'
headers.'Accept' = 'application/octet-stream'
response.'200' = {resp, binary ->