Python: #!/usr/bin/env python3
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
pip freeze | xargs pip uninstall -y |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/env python3 | |
# How to get Typer to behave like it has a default command. | |
# source: https://github.com/tiangolo/typer/issues/18#issuecomment-617089716 | |
import typer | |
app = typer.Typer() | |
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
# Parse a string given in "# #/# oz" into a decimal value. | |
parse_ounces <- function(val) { | |
if (val == "For glass") { return(1) } | |
if (str_detect(val, "or")) { | |
val <- str_remove(val, "or.+$") | |
} | |
val_pieces <- str_remove_all(val, "oz|slices|tsp|dash") %>% | |
str_trim() %>% |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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) | |
#### MAKING MOCK DATA #### | |
# Some parameters for amount of data. | |
n_metabs <- 5 | |
n_tissues <- 10 | |
tissues <- purrr::map_chr(1:n_tissues, ~ paste0(sample(letters, 3), collapse="")) | |
# Make a wide table of data, adding on columns per metabolite |
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
# An empty directory. | |
mkdir empty-dir | |
# A directory with files to delete. | |
mkdir bar | |
touch bar/someFile.txt | |
# Delete files in "bar/" | |
rsync -a --delete empty-dir/ bar/ |
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
# A function factory for getting integer y-axis values. | |
integer_breaks <- function(n = 5, ...) { | |
fxn <- function(x) { | |
breaks <- floor(pretty(x, n, ...)) | |
names(breaks) <- attr(breaks, "labels") | |
breaks | |
} | |
return(fxn) | |
} | |
Here is how you can link to [a post]({{< ref "/post/some_post.md" >}}) in Academic Kickstarter for Hugo.
NewerOlder