Skip to content

Instantly share code, notes, and snippets.

@justmytwospence
justmytwospence / mathjax-tumblr
Last active December 26, 2015 00:29
Web: Configure and source MathJax using their content distribution network. Place these two scripts in your tumblr header.
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: {autoNumber: "AMS"} },
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
@justmytwospence
justmytwospence / embed-gist-in-tumblr
Last active December 25, 2015 22:29
Web: Embed a gist in your tumblr blog.
# 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>
@justmytwospence
justmytwospence / snip.R
Last active August 19, 2019 09:15
R: Copy R output to the Mac OSX clipboard
snip <- function(input) {
pb <- pipe("pbcopy", "w")
write(input, file=pb)
close(pb)
}
@justmytwospence
justmytwospence / theme-xkcd
Last active December 14, 2015 09:58
R: An XKCD theme for ggplot2
### 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")
)