Skip to content

Instantly share code, notes, and snippets.

@pedro pedro/init.r
Last active Aug 29, 2015

What would you like to do?
R + Redis on Heroku
# used by the R buildpack to install dependencies:
install.packages("rredis", dependencies = TRUE)
redis_url <- Sys.getenv("REDIS_URL")
host <- gsub("redis://.*@(.+):.*", "\\1", redis_url)
pass <- gsub("redis://.*:(.+)@.*", "\\1", redis_url)
port <- as.integer(gsub(".*:(.*)$", "\\1", redis_url))
redisConnect(host=host, port=port, password=pass)
# set/get stuff:
redisSet("foo", "bar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.