Skip to content

Instantly share code, notes, and snippets.

View juliasilge's full-sized avatar
🐛

Julia Silge juliasilge

🐛
View GitHub Profile
@jeremy-allen
jeremy-allen / delete_tweets.R
Created May 11, 2021 13:09
Delete all tweets older than 30 days unless they have certain hashtags
library(here)
library(rtweet)
library(tidyverse)
library(assertthat)
#---- prep ----
my_dir <- here()
@topepo
topepo / two_class_diag_plots.R
Created May 6, 2021 22:00
two class diagnostic plots for shinymodels
library(tidymodels)
tidymodels_prefer()
theme_set(theme_bw())
library(doMC)
registerDoMC(cores = 20)
# ------------------------------------------------------------------------------
data(ad_data)
@topepo
topepo / regression_diag_plots.R
Created May 6, 2021 21:57
Regression diagnostic plots for shinymodels
library(tidymodels)
library(rules)
tidymodels_prefer()
theme_set(theme_bw())
library(doMC)
registerDoMC(cores = 20)
# ------------------------------------------------------------------------------
# Colors via http://clrs.cc/
clrs <- list(
  navy = "#001F3F",
  blue = "#0074D9",
  aqua = "#7FDBFF",
  teal = "#39CCCC",
  olive = "#3D9970",
  green = "#2ECC40",
 lime = "#01FF70",
library(tidymodels)
library(Matrix)
library(lobstr)
# ------------------------------------------------------------------------------
rand_values <- function (prefix = "step", len = 3, num_vals = Inf) {
candidates <- c(letters, LETTERS, paste(0:9))
candidates <- candidates[1:min(length(candidates), num_vals)]
@topepo
topepo / get_default_values.R
Created December 4, 2019 01:22
(try to) determine the default values for parsnip model arguments
get_default_values <- function(model, engine, mode) {
eng <- engine
mod_args <-
parsnip::get_from_env(paste0(model, "_args")) %>%
dplyr::filter(engine == eng)
model_fun <-
parsnip::get_from_env(paste0(model, "_fit")) %>%
dplyr::filter(engine == eng) %>%
dplyr::mutate(pkg = purrr::map_chr(value, ~ .x$func["pkg"]),
fun = purrr::map_chr(value, ~ .x$func["fun"]))
@sa-lee
sa-lee / gist:a3d6f5f582485f65d111f2b287b46ac2
Last active October 29, 2019 03:04
gif a tour that shows in rmd / rstudio viewer pane
gif_tour <- function(data, tour_path, display, ... ) {
  dir <- tempdir()
  png_path <- file.path(dir, "frame%03d.png")
  
  tourr::render(data,
                tour_path = tour_path,
                display = display,
                dev = "png",
                png_path,
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active November 6, 2024 15:21
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@notwaldorf
notwaldorf / list.md
Last active January 13, 2024 11:09
Meownica's packing list

Meownica's packing list

I travel a lot so I'm down to like 30 minutes of packing per any kind of trip. I always bring one carry-on suitcase for any trips up to 2 weeks (that I never check in unless forced) -- I have an Away suitcase because it's got a built-in (removable) battery, and amazing wheels.

🚨

  • 🆔Wallet & Passport
  • 💧Travel water bottle
  • 💳Travel credit cards (don't pay foreign currency fees!)
  • 💳Insurance cards
  • 💵Local currency you have
  • 🚎Local public transport cards