This file contains hidden or 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(httr) | |
library(magick) | |
library(hrbrthemes) | |
library(ggplot2) | |
theme_tweet_rc <- function(grid = "XY", style = c("stream", "card"), retina=TRUE) { | |
style <- match.arg(tolower(style), c("stream", "card")) | |
switch( |
This file contains hidden or 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
# case_when factory: ---------------------------------------------- | |
create_case_when <- function(..., vars = "x") { | |
fun_fmls <- purrr::map(rlang::set_names(vars), ~ rlang::missing_arg()) | |
fun_body <- substitute({ | |
for (name in var) { | |
symb <- rlang::eval_bare(rlang::sym(name)) | |
var <- rlang::eval_tidy(rlang::enquo(symb)) | |
assign(name, var) | |
} | |
forms <- purrr::map(formulas, rlang::`f_env<-`, value = environment()) |
This file contains hidden or 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
sapply(list.files(pattern = "\\.html$"), function(file) { | |
html <- readLines(file) | |
new_html <- gsub( | |
"https:.*?MathJax\\.js\\?", | |
"https://mathjax.rstudio.com/latest/MathJax.js?", | |
html | |
) | |
writeLines(new_html, file) | |
}) |
This file contains hidden or 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
# Copyright (C) 2018 C. Dervieux | |
# Licence MIT - https://spdx.org/licenses/MIT.html | |
#' Update git remote url from R | |
#' | |
#' If git remote server is migrated and url is changed, this function allows to easily update | |
#' the url of local git repo to the new git remote url. | |
#' | |
#' This function need `git2r`, `urltools` and `glue` to work. | |
#' |
This file contains hidden or 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
:root { | |
--baseline: var(--font-lineHeight); | |
--baseline-color: red; | |
} | |
.pagedjs_page { | |
/* grid baseline */ |
OlderNewer