This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)]/" | |
} | |
export PS1="\n\[$BPurple\][\w]\n\[$BCyan\]\u@\h \[$BGreen\]\$(parse_git_branch)\n$\[$Color_Off\] " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change the number of digits displayed on ggplot axes | |
# Define a number formatting function | |
fmt <- function(ndec) { | |
function(x) format(x,nsmall=ndec) | |
} | |
ggplot(mpg, aes(x=mpg$displ,y=mpg$hwy)) + | |
geom_point() + | |
scale_x_continuous(labels=fmt(2)) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Include Band #'s with Donation Labels' */ | |
(function($){ | |
var iframe = document.getElementById("can_embed_iframe"); // Get the iFrame with the Form | |
var innerDoc = iframe.contentDocument || iframe.contentWindow.document; // Address iFrame as contentDocument | |
var labels = innerDoc.getElementsByClassName("donate_amount"); // Array of <label> HTML objects | |
for (i = 0, band = 1; i < labels.length; i++, band++) { // i = label array, band = band # | |
labels[i].innerText = "Band " + band + ": \n" + labels[i].innerText; | |
} | |
})(jQuery); |