Skip to content

Instantly share code, notes, and snippets.

View yonik's full-sized avatar

Yonik Seeley yonik

View GitHub Profile
@yonik
yonik / getclasses.py
Created January 3, 2018 22:34
getclasses.py
import javalang
import sys
def addextends(out, etype, val):
if isinstance(etype, list):
for et in etype:
addextends(out, et, val)
return
if not etype:
function find_git_branch {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head == ref:\ refs/heads/* ]]; then
git_branch="[${head##*/}] "
elif [[ $head != '' ]]; then
git_branch='[detached] '