Skip to content

Instantly share code, notes, and snippets.


Rafal Woloszyn rwoloszyn

View GitHub Profile
six519 /
Last active Oct 8, 2017
Install node/npm/nvm Bash Script In FreeBSD 10.2
#!/usr/bin/env bash
#just want to post something!!!!!! :D
sudo pkg install node www/npm git gmake wget
wget -qO- | bash
dciccale /
Created May 11, 2013
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"