Skip to content

Instantly share code, notes, and snippets.

View jonthegeek's full-sized avatar

Jon Harmon jonthegeek

View GitHub Profile
@jonthegeek
jonthegeek / extract_api.R
Created May 12, 2022 14:17
The start of an openAPI Parser
api_spec <- jsonlite::read_json("R-raw/swagger.json")
# I never got to the point of actually using this here, but this is where it is.
base_path <- api_spec$servers[[1]]$url
methods <- tibble::enframe(
x = api_spec$paths,
name = "path"
) %>%
tidyr::unnest_wider(value) %>%
@jonthegeek
jonthegeek / app.R
Created January 10, 2020 17:39
Shiny Module Functions: Communication Between Modules
# Adapted from https://rpodcast.shinyapps.io/modules_article1/ to test callModule as a function.
# load packages
library(shiny)
library(AmesHousing)
library(dplyr)
library(rlang)
library(ggplot2)
library(scales)
# (?<= ) means "look for a space before this, but don't include it in what we
# extract."
# Square brackets mean "look for any of these", so [a-z() ] means "look for
# lowercase letters, parentheses, or spaces."
# The plus sign means "find at least one of these."
# The dollar sign means "this has to occur at the end of the text."
target <- "(?<= )[a-z() ]+$"
commute_mode %>%
dplyr::mutate(
frink <- magick::image_read(
"https://jeroen.github.io/images/frink.png"
)
bitmap <- frink[[1]]
radius <- 20
x_seq <- seq_len(dim(bitmap)[[2]])
y_seq <- seq_len(dim(bitmap)[[3]])
center_x <- median(x_seq)
center_y <- median(y_seq)
for(x in x_seq) {
@jonthegeek
jonthegeek / macmillan-learning-cla.md
Created September 12, 2019 16:52
Macmillan Learning Individual Contributor License Agreement

By signing this contributor license agreement, I understand and agree that this project and contributions to it are public and that a record of the contribution (including all personal information I submit with it, including my full name and email address) is maintained indefinitely and may be redistributed consistent with this project, compliance with the open source license(s) involved, and maintenance of authorship attribution. In order to clarify the intellectual property license granted with Contributions from any person or entity, Bedford Freeman & Worth Pub Grp LLC DBA Macmillan Learning ("Macmillan Learning") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Macmillan Learning; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Y