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
| ### 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 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
| snip <- function(input) { | |
| pb <- pipe("pbcopy", "w") | |
| write(input, file=pb) | |
| close(pb) | |
| } |
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
| # 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 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
| <!-- MathJax configuration --> | |
| <script type="text/x-mathjax-config"> | |
| MathJax.Hub.Config({ | |
| TeX: { equationNumbers: {autoNumber: "AMS"} }, | |
| tex2jax: { | |
| inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
| processEscapes: true | |
| } | |
| }); | |
| </script> |
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
| find . -size +1G | cat >> .gitignore |
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
| 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 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
| <?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 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
| % FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX | |
| % Author: Honza Ustohal <[email protected]> | |
| % A few icons added by: Spencer Boucher <[email protected]> | |
| % | |
| % 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 | |
| % |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer