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
# Usage: $ lmake <make options here> <optional make target> | |
function lmake () | |
{ | |
echo "Appending make command output to make.log" | |
echo "Running command..." | |
echo "" >>make.log | |
echo "------------------------------------------" >>make.log | |
echo " MAKE LAUNCHED" >>make.log |
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
# Source a file in the same directory as the script regardless of the | |
# working directory from which the script is being called. | |
# Works in conjunction with argparser. | |
# Adapted from http://stackoverflow.com/a/1815743 | |
command <- commandArgs(trailingOnly = FALSE) | |
script_name <- sub("--file=", "", command[grep("--file=", command)]) | |
script_path <- dirname(script_name) | |
my_functions <- file.path(script_path, "functions.R") | |
source(my_functions, chdir = TRUE) |
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
PROMPT=" %{$fg[magenta]%}%n%{$reset_color%} @ %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%c%{$reset_color%} # %{$fg[blue]%}\${STY}%{$reset_color%} # %{$fg[blue]%}\$(git_prompt_info)%{$fg[blue]%} % %{$reset_color%} | |
%{$fg[blue]%}➜ %{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%} %{$fg[green]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" |
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
R -e 'library(knitr); knit("report.Rmd", "report.md")'; pandoc report.md --output snapshot.pdf --variable 'geometry:margin=1in' |
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
```{r setup, echo = FALSE, message = FALSE, warning = FALSE} | |
knitr::opts_chunk$set(dev = "pdf", # Save figures as PDFs | |
fig.keep = "all", | |
fig.path = "figures/", # Figures are saved to this directory | |
message = FALSE, # Hide messages/warnings/errors from loading packages | |
warning = FALSE, | |
error = FALSE, | |
cache = TRUE) # By default, cache results to avoid re-running | |
# super long things every time you knit |
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
# Filters | |
library(tidyverse) | |
sample_filters <- quos(project %in% c("dev", species %in% c("mouse"))) | |
sample_list <- data.frame( | |
project = c("dev", "pbt"), | |
species = c("mouse", "human"), | |
dont_filter = c("a", "b")) |
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
# to add to ~/.bashrc | |
# e.g. selinjessa @ iMacPro @ ~ # 22846.test $ | |
export PS1="\[\e[34m\]\u \[\e[m\]@ \[\e[31m\]\h \[\e[m\]@ \[\e[36m\]\W \[\e[m\]# ${STY} $ " |
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
# save in .bashrc | |
# usage: knit 01-analysis.Rmd | |
function knit() { | |
R --no-save -e "rmarkdown::render('""$1""', 'html_document')" | |
} |