$ git clone https://github.com/briandk/latexer.git
To install my package in development mode[^1] in Github Atom,
$ cd latexer && \
\
# checkout my feature branch \
<span id='foo'>Doctor Strange</span> | |
<script> | |
const bar = function () { return('hooray!'); }; | |
// what's the difference between onclick and .addEventListener? | |
bar.onclick = foo; | |
bar.addEventListener('click', foo); | |
</script> |
# Here's a dictionary literal with data and behavior in one line of code | |
baby1 = { | |
"first_function": lambda x: x + 1, | |
"first_words": "Zoiby want to buy on margin" | |
} | |
# Here's a much more complicated OOP solution in 5 lines | |
class Baby: | |
def __init__(self, first_function, first_words): | |
""" |
PIRATES OF THE CARRIBEAN: DEAD MAN'S CHEST, by Ted Elliott & Terry Rossio | |
[view looking straight down at rolling swells, sound of wind and thunder, then a low heartbeat] | |
Scene: PORT ROYAL | |
[teacups on a table in the rain] | |
[sheet music on music stands in the rain] | |
[bouquet of white orchids, Elizabeth sitting in the rain holding the bouquet] | |
[men rowing, men on horseback, to the sound of thunder] | |
[EITC logo on flag blowing in the wind] | |
[many rowboats are entering the harbor] | |
[Elizabeth sitting alone, at a distance] |
EnsurePackage <- function(x) { | |
x <- as.character(x) | |
# the code below can probably be vectorized with apply or a for-in | |
if (!require(x, character.only=TRUE)) { | |
install.packages(pkgs=x, | |
repos="http://cran.r-project.org") | |
require(x, character.only=TRUE) | |
} | |
} |
$ git clone https://github.com/briandk/latexer.git
To install my package in development mode[^1] in Github Atom,
$ cd latexer && \
\
# checkout my feature branch \
current_directory = $(shell pwd) | |
manuscript_file = "toce-manuscript.Rmd" | |
manuscript: | |
docker run \ | |
--rm \ | |
-v $(current_directory):/manuscript \ | |
manuscribble \ | |
-e 'rmarkdown::render($(manuscript_file), output_format="all")' |
# defensive package loading in pure R | |
# inspired by @wildoane | |
install_packages_if_necessary <- function (dependencies) { | |
packages_to_install <- setdiff(dependencies, installed.packages()) | |
for (package in packages_to_install) { | |
install.packages(package, dependencies = TRUE) | |
} | |
} |