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
services: | |
# ollama and API | |
ollama: | |
image: ollama/ollama:latest | |
container_name: ollama | |
pull_policy: missing | |
tty: true | |
restart: unless-stopped | |
# Expose Ollama API outside the container stack (but only on the same computer; |
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/Rscript | |
# Command line application Bluesky feed reader based on atrrr. | |
# | |
# Make executable with `chmod u+x rbsky`. | |
# | |
# If you are on macOS, you should replace the first line with: | |
# | |
# #!/usr/local/bin/Rscript | |
# |
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 | |
# query the newes version of docker-compose and add to a path folder | |
latest=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name') | |
sudo curl -L "https://github.com/docker/compose/releases/download/$latest/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
echo "$(docker-compose --version) installed" |
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
#' Make ICS calendar file | |
#' | |
#' Make an ICS calendar file from the text-as-data reading group Google sheet | |
#' for importing events into your calendar. | |
#' | |
#' @param sheet URL of the Google sheet (current URL in example). | |
#' @param location currently the link to register on Zoom. | |
#' @param outfile file name of the output ics file. | |
#' | |
#' @return |
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
#' Helps you get the neede packages | |
#' | |
#' @param x package name | |
install_missing <- function(x) { | |
if (!x %in% installed.packages()[, "Package"]) { | |
res <- menu(c("yes", "no"), title = paste0("Install missing package ", x, "?")) | |
if (identical(res, 1L)) { | |
if (x != "traktok") { | |
install.packages(x) | |
} else { |
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
#' Install old packages in new version of R | |
#' | |
#' @param old_path Input the libPath of the old R version. Leave blank to detect | |
#' automatically. | |
#' | |
#' @return | |
#' @export | |
#' | |
#' @examples | |
#' get_old_packages() |
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
# get all packages | |
pkgs <- installed.packages()[, 1] | |
# make progress bar | |
pb <- progress::progress_bar$new(total = length(pkgs)) | |
fcts <- purrr::map_df(pkgs, function(x) { | |
pb$tick() |
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
#' Recovers Twitter damaged stream data (JSON file) into parsed data frame. | |
#' | |
#' @param path Character, name of JSON file with data collected by | |
#' \code{\link{stream_tweets}}. | |
#' @param dir Character, name of a directory where intermediate files are | |
#' stored. | |
#' @param verbose Logical, should progress be displayed? | |
#' | |
#' @family stream tweets | |
recover_stream <- function(path, dir = NULL, verbose = TRUE) { |