Skip to content

Instantly share code, notes, and snippets.

View peburrows's full-sized avatar

Phil Burrows peburrows

View GitHub Profile
@peburrows
peburrows / .bashrc
Created November 29, 2011 02:42 — forked from henrik/.bashrc
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@peburrows
peburrows / gist:1138773
Created August 11, 2011 02:16 — forked from carolineschnapp/related-products.liquid
Related Products — to add to product.liquid
<!-- Solution brought to you by Caroline Schnapp -->
<!-- See this: http://wiki.shopify.com/Related_Products -->
{% assign number_of_related_products_to_show = 3 %}
{% assign image_size = 'compact' %}
{% assign heading = 'Other fine products' %}
{% capture number_of_related_products_to_fetch %}{{ number_of_related_products_to_show | plus: 1 }}{% endcapture %}
{% if collection == null or collection.handle == 'frontpage' or collection.handle == 'all' %}