Skip to content

Instantly share code, notes, and snippets.

Avatar

Barbara Borges Ribeiro bborgesr

View GitHub Profile
@wch
wch / proxy.R
Last active Feb 22, 2018
Quick and dirty HTTP proxy in R
View proxy.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 Jun 15, 2018
How to Give an Exceptionally Good Presentation
View exceptionally-good-presentations.txt
"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 Jan 17, 2018
httpuv application that listens for R commands in background
View listen.R
# 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 Feb 8, 2021
Connect R (#rstats) to heroku PostgreSQL — https://www.heroku.com/postgres
View heroku-pg.r
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