Skip to content

Instantly share code, notes, and snippets.


Barbara Borges Ribeiro bborgesr

View GitHub Profile
bborgesr / shiny-insertUI-removable.R
Last active Apr 11, 2019
Uses Shiny's insertUI to create elements (in this example, datatables) at the user's discretion; each of these comes with a button that will remove it from the app (using removeUI).
View shiny-insertUI-removable.R
ui <- fluidPage(
textInput("divID", "Enter an ID for the custom area:", ""),
helpText("Leave the text input blank for automatically unique IDs."),
actionButton("isrt", "Add a datatable"),
tags$div(id = "placeholder")
server <- function(input, output, session) {
rv <- reactiveValues()
bborgesr / cards-crud-inside-map-inside-buildCards.js
Last active Mar 14, 2019
[Make a CMS card's id unique] Reusing existing code, and keeping in mind that it's preferrable to destructure the object rather than mutate the id in place. #cms
View cards-crud-inside-map-inside-buildCards.js
try {
const card = buildCard(
Object.assign({}, settingsAndOptions, { cardIndex })
return {...card, id: `${}:${cardIndex}`};
bborgesr / exceptionally-good-presentations.txt
Created Feb 8, 2018 — forked from jmcphers/exceptionally-good-presentations.txt
How to Give an Exceptionally Good Presentation
View exceptionally-good-presentations.txt
Joe Cheng.............Moderator
Jennifer Bryan........As Herself
Hadley Wickham........As Himself
Aron Atkins...........Audience
Derrick Kearney.......Audience
bborgesr / shiny-simple-iterative-printing.R
Created May 5, 2017
Two simple examples of iterative printing in Shiny
View shiny-simple-iterative-printing.R
# By default Shiny will always wait for any reactive dependencies to finish (re)calculcating
# before displaying the output that depends on them. Without async reactivity in Shiny (which
# is not currently available, but it's in the works), it's actually not really possible to
# make a reactive dependency be available before it finishes computing. But you can redefine
# your reactive so that its output is broken though.
# You can achieve this using reactive values, an observer and invalidateLater(). If this is
# new for you, I'd recommend, you read the documentation about invalidateLater().
# I'll show two simple examples here. For a more elaborate example, see this gist.
bborgesr / shiny-1.0.1-new-features.R
Created Mar 30, 2017
"Exciting" new features in Shiny 1.0.1
View shiny-1.0.1-new-features.R
# ----------------------------------------------------------------- #
# ------------- "Exciting" new features in Shiny 1.0.1 ------------ #
# ----------------------------------------------------------------- #
# 1. ----------------------------------------------- #
# ------------------ reactiveVal() ----------------- #
# -------------------------------------------------- #
ui <- fluidPage(
bborgesr / iterative-comp-shiny.R
Created Mar 6, 2017
An example of doing prolonged, iterative computation in Shiny. Adapted from:
View iterative-comp-shiny.R
ui <- fluidPage(
numericInput("steps", "Time steps:", 10, min=1),
actionButton("run", label="Start")
bborgesr / database-benchmarking.Rmd
Created Jun 23, 2016
Comparing the time that a query takes to run using three different models of database connection: one connection per program/app; one connection per query; using a connection pool.
View database-benchmarking.Rmd
title: "Benchmarking database queries"
author: "Barbara Borges Ribeiro"
date: "June 23, 2016"
output: html_document
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)