Skip to content

Instantly share code, notes, and snippets.

View jnolis's full-sized avatar
💖

Jacqueline Nolis jnolis

💖
View GitHub Profile
@jnolis
jnolis / board.Rmd
Created August 28, 2023 23:02
Bingo Rmarkdown
---
params:
board: null
n: 0
total: 0
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(include = FALSE)
library(gt)
@jnolis
jnolis / bingo.R
Last active August 31, 2023 13:17
Generate bingo sheets
# This code generates however many bingo sheets you need
# It requires you to have "squares.csv", a single column csv file with
# name "square" and a row for the text in each square.
#
# You also need to install wkhtmltopdf https://wkhtmltopdf.org/ and
# add it to your system path. This converts the html to a pdf page
# libraries: tidyverse, glue, rmarkdown
#
# Also make a folder "output" to store them to
library(ggplot2)
library(ggirl)
# create the plot
plot <- ggplot() +
geom_polygon( data=map_data("state"), aes(x=long, y=lat, group=group),
fill="#cdddee", color="#7296bc" )+
geom_point(data = data.frame(long = -77.01728, lat = 38.78125),
aes(x=long, y=lat),
@jnolis
jnolis / saturn.json
Last active February 21, 2022 14:37
Temp recipe
{
"name": "usage-reporting-prod",
"image_uri": "saturncloud/saturn-rstudio:2022.01.06",
"description": "API endpoint for Saturn Cloud usage hosted with R and plumber",
"working_directory": "/home/jovyan/usage-reporting",
"start_script": "Rscript startup.R",
"git_repositories": [
{
"url": "git@github.com:saturncloud/usage-reporting.git",
"location": "/home/jovyan/usage-reporting",
@jnolis
jnolis / saturn.json
Last active December 14, 2021 17:22
nvidia-usage-gist
{
"name": "nvidia-usage-alerting",
"image_uri": "saturncloud/saturn-r:2021.11.10-2",
"description": "",
"environment_variables": {},
"working_directory": "/home/jovyan/git-repos/nvidia-reporting",
"start_script": "Rscript reports/alerts.R",
"git_repositories": [
{
"url": "git@github.com:saturncloud/nvidia-reporting.git",
{
"name": "nvidia-reporting-test",
"image_uri": "saturncloud/saturn-r:2021.11.10-2",
"description": "",
"environment_variables": {},
"working_directory": "/home/jovyan/git-repos/nvidia-reporting",
"extra_packages": {
"apt": "unixodbc unixodbc-dev",
"conda": "",
"pip": "",
@jnolis
jnolis / advent_of_code_2021_day_7.R
Created December 7, 2021 05:53
Advent of Code 2021 Day 7
library(tidyverse)
data <-
read_lines("07/input.txt") %>%
str_split(",") %>%
.[[1]] %>%
as.integer()
# part 1
# the optimal location to meet is exactly the median (think L1 space if you're mathy)
{
"name": "embed-recipe-site",
"image_uri": "saturncloud/saturn-r:2021.11.10-2",
"description": "A simple website with R and Shiny for embedding recipe links",
"environment_variables": {},
"working_directory": "/home/jovyan/git-repos/embed-recipes-site",
"extra_packages": {
"use_mamba": true,
"conda": "",
"apt": "libv8-dev",
@jnolis
jnolis / example_furrr
Created June 30, 2021 04:11
group_split + furrr::map_dfr()
library(furrr)
library(dplyr)
future::plan(future::multisession()) # This is for windows, might want something else for Linux
data <- data.frame(letter = sample(letters,num_samples, replace = TRUE),
value = runif(num_samples))
data %>%
group_by(letter) %>%
library(tidyverse)
library(jsonlite)
x <- tribble(
~name, ~city, ~age,
"Heather", "Renton", 31,
"Jacqueline", "Issaquah", 34
)
# BAD WAY