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
# Compare hashes of identically named files across two project versions, | |
# e.g. if the project was run again with different versions of dependencies. | |
# >>> Assumes files are uniquely named within a project <<< | |
# (replace vector of paths appropriately) | |
library(digest) | |
library(tidyverse) | |
files_to_check_01 <- list.files( | |
# Check all of the files in these directories |
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
# Extract a list of citation keys from an Rmd file, | |
# paste them together to search in Mendeley to make | |
# a list of references in that Rmd file | |
rmd_file <- "path_to_Rmd_file" | |
citations <- | |
readr::read_lines(rmd_file) %>% | |
stringr::str_split(" |;") %>% | |
unlist %>% |
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
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: resolver | |
namespace: gn | |
labels: | |
app: resolver | |
tier: frontend | |
spec: |
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
library(bib2df) | |
library(rcrossref) | |
library(tidyverse) | |
# Double check to make sure DOIs in bibliography match the right papers | |
# Load clean bibliography, select just relevant columns | |
path_to_bib <- "ms/references.bib" | |
bib <- bib2df(path_to_bib) %>% |
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
library(tidyverse) | |
# Find the names of latex packages installed by tlmgr | |
# (https://www.tug.org/texlive/tlmgr.html) | |
# The main reason to do this is so they can be pre-installed to a docker image. | |
# | |
# The latex package install output from tlmgr tends to look like this: | |
# | |
# ``` | |
# tlmgr search --file --global '/multirow.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
library(tidyverse) | |
# Extract names of files in a "data_raw" folder | |
# and append "put" so they can easily be uploaded to | |
# a server using sftp | |
plan_lines <- read_lines("code/world_biogeo_plan.R") | |
plan_lines %>% | |
magrittr::extract(str_detect(., "data_raw")) %>% |
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
#' Write out a list of DNA sequences in chunks | |
#' | |
#' The list will be split into a list of lists, to | |
#' save memory when writing out sequences. | |
#' | |
#' @param fasta_list The list of DNA sequences | |
#' @param chunk_size Size of chunks to split up list into. | |
#' @param out_dir Directory to write to | |
#' | |
#' @return List of hashes; digest of each chunk. Externally, the |
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
joelnitta@Joels-iMac repos % git clone https://github.com/joelnitta/i18n | |
Cloning into 'i18n'... | |
remote: Enumerating objects: 1672, done. | |
remote: Total 1672 (delta 0), reused 0 (delta 0), pack-reused 1672 | |
Receiving objects: 100% (1672/1672), 2.73 MiB | 2.43 MiB/s, done. | |
Resolving deltas: 100% (1167/1167), done. | |
joelnitta@Joels-iMac repos % cd i18n | |
joelnitta@Joels-iMac i18n % git submodule init | |
Submodule 'git-novice' (https://github.com/swcarpentry-i18n/git-novice.git) registered for path 'git-novice' | |
Submodule 'po4gitbook' (https://github.com/swcarpentry-i18n/po4gitbook.git) registered for path 'po4gitbook' |
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
# Set working directory | |
setwd(here::here()) | |
# Load packages and functions | |
source("r-code/01_start_up.R") | |
# Load plan | |
source("r-code/plan.R") | |
# Load cache |
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
#!/usr/bin/bash | |
# Start docker daemon in background | |
nohup dockerd-rootless.sh --experimental --storage-driver vfs >| dockerd.log 2>&1 & | |
# Save the process ID so we can kill it later | |
echo $! > dockerd.pid | |