Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
function collision($div1, $div2) { | |
var x1 = $div1.offset().left; | |
var y1 = $div1.offset().top; | |
var h1 = $div1.outerHeight(true); | |
var w1 = $div1.outerWidth(true); | |
var b1 = y1 + h1; | |
var r1 = x1 + w1; | |
var x2 = $div2.offset().left; | |
var y2 = $div2.offset().top; | |
var h2 = $div2.outerHeight(true); |
function getNoun(number, one, two, five) { | |
let n = Math.abs(number); | |
n %= 100; | |
if (n >= 5 && n <= 20) { | |
return five; | |
} | |
n %= 10; | |
if (n === 1) { | |
return one; | |
} |