Skip to content

Instantly share code, notes, and snippets.

View bborgesr's full-sized avatar

Barbara Borges Ribeiro bborgesr

View GitHub Profile
@wch
wch / proxy.R
Last active February 22, 2018 21:14
Quick and dirty HTTP proxy in R
library(curl)
library(httpuv)
req_rook_to_curl <- function(req, host) {
# browser()
# Rename headers. Example: HTTP_CACHE_CONTROL => Cache-Control
r <- as.list(req)
# Uncomment to print out request headers
cat("== Original ==\n")
@jmcphers
jmcphers / exceptionally-good-presentations.txt
Last active June 15, 2018 16:36
How to Give an Exceptionally Good Presentation
"HOW TO GIVE AN EXCEPTIONALLY GOOD PRESENTATION"
CHARACTERS
Joe Cheng.............Moderator
Jennifer Bryan........As Herself
Hadley Wickham........As Himself
Aron Atkins...........Audience
Derrick Kearney.......Audience
@wch
wch / listen.R
Last active January 17, 2018 20:24
httpuv application that listens for R commands in background
# This application will listen for local connections on port 7000 and run
# commands it receives via HTTP POST. It will run commands using the later
# packages -- that is, whenever the R call stack is empty (it is idle at the R
# prompt), or whenever later::run_now() is called. Shiny keeps calling run_now()
# when running an application, so this can run commands when a Shiny application
# is running.
#
# This can be useful for enabling options while a Shiny application is running.
# For example, you can use it to run `options(shiny.trace=TRUE)` without
@hrbrmstr
hrbrmstr / heroku-pg.r
Last active October 25, 2021 01:15
Connect R (#rstats) to heroku PostgreSQL — https://www.heroku.com/postgres
library(processx)
library(RPostgres)
library(httr)
library(dbplyr)
library(tidyverse)
# this example assumes you've created a heroku postgresql
# instance and have the app name (in this example, "rpgtestcon").
# use the heroku command-line app