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
library(shiny)
ui <- fluidPage()
server <- function(input, output, session) {
}
# Creating the shiny object
res <- shinyApp(ui, server)
@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
@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;
library(shiny)
ui <- function(request){
tagList(
tags$button(
"glop",
onclick = "Shiny.setInputValue('cont', document.documentElement.innerHTML)"
)
)
}
library(future)
plan(multisession)
checks <- function(x){
if(resolved(x)){
print(value(x))
} else {
later::later(~ checks(x), 2)
}
@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
@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 / browser_n()
Created November 26, 2019 20:52
browser_n
browser_n <- function(n){
i <- 0
function(...){
i <<- i + 1
if (n >= i){
browser(...)
} else {
invisible(NULL)
}
}
@ColinFay
ColinFay / r-from-source.md
Created November 13, 2019 09:49
Installing R from source

Install R from source

Set R version and dl it

(you can modify the cran mirror)

R_VERSION='3.6.1'
wget https://cran.univ-paris1.fr/src/base/R-3/R-${R_VERSION}.tar.gz