Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafal Woloszyn rwoloszyn

View GitHub Profile
@six519
six519 / setup.sh
Last active Oct 8, 2017
Install node/npm/nvm Bash Script In FreeBSD 10.2
View setup.sh
#!/usr/bin/env bash
#just want to post something!!!!!! :D
sudo pkg install node www/npm git gmake wget
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
@dciccale
dciccale / git_branch.sh
Created May 11, 2013
Bash script to get the current git branch and last commit
View git_branch.sh
#!/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)/"