I hereby claim:
- I am xamebax on github.
- I am paciorkowska (https://keybase.io/paciorkowska) on keybase.
- I have a public key ASBAE3EJFub_1PRGlBt3xDJsiWnzWORKdhsf4UYKOfCxtwo
To claim this, I am signing this object:
| # get current branch in git repo | |
| function parse_git_branch() { | |
| BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
| if [ ! "${BRANCH}" == "" ] | |
| then | |
| STAT=`parse_git_dirty` | |
| echo "( ${BRANCH}${STAT} )" | |
| else | |
| echo "" | |
| fi |
I hereby claim:
To claim this, I am signing this object:
| require 'json' | |
| def pretty_json(vv, prefix='$') | |
| if vv.is_a?(Array) | |
| vv.each_with_index do |i, v| | |
| pretty_json(v, "#{prefix}[#{i}]") | |
| end | |
| elsif vv.is_a?(Hash) | |
| vv.each do |k, v| | |
| pretty_json(v, "#{prefix}.#{k}") |
| #!/usr/bin/env python | |
| import json | |
| import sys | |
| def pp(vv, prefix='$'): # vv = array w/ JSON data, prefix = what's printed at the start of each line | |
| if isinstance(vv, (list,tuple)): # if vv is a list/tuple - an Array in Ruby | |
| for i, v in enumerate(vv): # vv being enumerated means each array element | |
| # is being given an "index", so (a, b, c) => [(0, a), (1, b), (2, c)]... | |
| # so for each "index" & "value" pair of the enumerated vv array... |