This file contains 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
### XKCD theme for ggplot2 | |
theme_xkcd <- theme( | |
panel.background = element_rect(fill="white"), | |
axis.ticks = element_line(colour=NA), | |
panel.grid = element_line(colour="white"), | |
axis.text.y = element_text(colour=NA), | |
axis.text.x = element_text(colour="black"), | |
text = element_text(size=16, family="Humor Sans") | |
) |
This file contains 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
snip <- function(input) { | |
pb <- pipe("pbcopy", "w") | |
write(input, file=pb) | |
close(pb) | |
} |
This file contains 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
# Place this into the header of your HTML | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
# Embed the gist using a div of this format: | |
<div class="gist">https://gist.github.com/`username`/`gist#`</div> |
This file contains 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
<!-- MathJax configuration --> | |
<script type="text/x-mathjax-config"> | |
MathJax.Hub.Config({ | |
TeX: { equationNumbers: {autoNumber: "AMS"} }, | |
tex2jax: { | |
inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
processEscapes: true | |
} | |
}); | |
</script> |
This file contains 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
find . -size +1G | cat >> .gitignore |
This file contains 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
stratified_sample <- function(df, size = .5, .by, seed = 37L) { | |
require(plyr) | |
set.seed(seed) | |
df.sample <- ddply(df, .by, | |
function(x) { | |
if (size < 1) { size <- size * nrow(x) } | |
return(x[sample(nrow(x), size = size),]) | |
}, | |
.progress = 'text') | |
return(df.sample) |
This file contains 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
<?php | |
$actual_file_name = "path/to/foo.pdf"; | |
$saved_file_name = "foo-bar.pdf" | |
header("Content-Type: application/pdf"); | |
header("Content-Disposition: attachment; filename=$saved_file_name"); | |
header("Content-Length: " . filesize($actual_file_name)); | |
readfile($actual_file_name); | |
exit; |
This file contains 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
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX | |
% Author: Honza Ustohal <honza@egoistic.biz> | |
% A few icons added by: Spencer Boucher <spencer.g.boucher@gmail.com> | |
% | |
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter | |
% This might be reworked into a full blown package in the near future | |
% | |
% Prerequisite: | |
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX | |
% |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer