Skip to content

Instantly share code, notes, and snippets.

View ColinFay's full-sized avatar
🦷
Because why not

Colin Fay ColinFay

🦷
Because why not
View GitHub Profile
@ColinFay
ColinFay / gitchunk
Last active December 3, 2019 22:27
```{r}
xml2::read_html("https://github.com/ThinkR-open/golem") %>%
rvest::html_nodes(".overall-summary-bottomless") %>%
as.character() %>%
htmltools::HTML()
```
@ColinFay
ColinFay / app.R
Last active January 26, 2020 15:53 — forked from MayaGans/app.R
library(shiny)
# MODULE UI
customInputUI <- function(id) {
ns <- NS(id)
verbatimTextOutput(ns("debug"))
}
# MODULE SERVER
# Render the custom shiny input binding
library(future)
plan(multisession)
checks <- function(x){
if(resolved(x)){
print(value(x))
} else {
later::later(~ checks(x), 2)
}
library(shiny)
ui <- function(request){
tagList(
tags$button(
"glop",
onclick = "Shiny.setInputValue('cont', document.documentElement.innerHTML)"
)
)
}
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@500&display=swap');
body {
background-color: #EBBE9B;
font-family: 'Ubuntu', sans-serif;
}
h1{
text-transform: uppercase;
color: #502419;
@ColinFay
ColinFay / fork-up-to-date
Last active October 9, 2020 15:59
Keep your fork up to date
# To do the first time
# git remote add upstream https://github.com/original-repo/goes-here.git
git fetch upstream
git rebase upstream/master
git push origin master --force
library(shiny)
ui <- fluidPage()
server <- function(input, output, session) {
}
# Creating the shiny object
res <- shinyApp(ui, server)
library(purrr)
list.files(
pattern = ".Store$",
recursive = TRUE,
full.names = TRUE,
all.files = TRUE
) %>%
map(unlink, TRUE, TRUE)
library(tidyverse)
raw_data <- read_csv("https://www.data.gouv.fr/fr/datasets/r/eb672d49-7cc7-4114-a5a1-fa6fd147406b")
df <- raw_data %>%
filter(
date == as.character(
Sys.Date() - 1
)
)