Skip to content

Instantly share code, notes, and snippets.

View groundh0g's full-sized avatar

Joseph Hall (groundh0g) groundh0g

View GitHub Profile

Add the current git branch to your bash prompt! In .bashrc:

parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;1;38;5;247m\]> \[\033[3;38;5;68m\]\W $(parse_git_branch)\[\033[00m\] '
else
 PS1='${debian_chroot:+($debian_chroot)}\W $(parse_git_branch)\[\033[00m\] '
@johnteske
johnteske / index.html
Created January 5, 2017 18:49
Liquid number format with commas
{% include numberWithCommas.html number=1 %}
{% include numberWithCommas.html number=12 %}
{% include numberWithCommas.html number=123 %}
{% include numberWithCommas.html number=1234 %}
{% include numberWithCommas.html number=12345 %}
{% include numberWithCommas.html number=123456 %}
{% include numberWithCommas.html number=1234567 %}
{% include numberWithCommas.html number=12345678 %}
{% include numberWithCommas.html number=123456789 %}
{% include numberWithCommas.html number=1234567890 %}