Moved to https://github.com/yihui/shiny-apps/tree/master/voice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSelenium + 2048 demo on Budapest RUG (BURN) meetup - Laszlo Szakacs, 2015-01-14 | |
# Commented and updated on 2015-01-18 | |
# Selenium: http://www.seleniumhq.org | |
# RSelenium: http://ropensci.github.io/RSelenium | |
# 2048: http://gabrielecirulli.github.io/2048 | |
# 2048 + R: http://decisionsandr.blogspot.hu/2014/04/play-2048-using-r.html | |
# Strategies: http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dygraphs) | |
lungDeaths <- cbind(ldeaths, mdeaths, fdeaths) | |
dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)") %>% | |
dyHighlight(highlightSeriesOpts = list(strokeWidth = 3)) -> d1 | |
#this is a hack to set css directly | |
# dyCSS designed to read a text css file | |
d1$x$css = " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(memisc) | |
library(stargazer) | |
library(pander) | |
lm0 <- lm(sr ~ pop15 + pop75, data = LifeCycleSavings) | |
lm1 <- lm(sr ~ dpi + ddpi, data = LifeCycleSavings) | |
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings) | |
mtable123 <- mtable("Model 1"=lm0,"Model 2"=lm1,"Model 3"=lm2, summary.stats=c("sigma","R-squared","F","p","N")) | |
pander(mtable123) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scale_x_discrete(limits = rev(levels(the_factor))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prevent postfix from prompting for hostname | |
sudo debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com" | |
sudo debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'" | |
sudo apt-get install -y postfix | |
# Install OpenCPU | |
sudo add-apt-repository -y ppa:opencpu/opencpu-2.0 | |
sudo apt-get update | |
sudo apt-get install -y opencpu-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;Record startup timestamp | |
(defvar Emacs/invokation-time | |
(current-time)) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(custom-enabled-themes (quote (tango-plus))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
batchimport <- function(url, batchsize = 1e6) { | |
# Globals | |
stack <- batches <- list(); | |
i <- j <- 1; | |
size <- 0; | |
# Function that parses intermediate json | |
clearstack <- function(all=FALSE){ | |
bigstr <- do.call(paste0, stack); | |
lines <- strsplit(bigstr, "\n")[[1]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y libssl1.0.0 openssl | |
# Confirm Build Date is at least Aril 7th 2014 | |
openssl version -a | |
# Restart all services listed by this command: | |
sudo lsof -n | grep ssl | grep DEL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RJSONIO) | |
library(httr) | |
library(ggplot2) | |
api_key <- scan("~/.meetup.apikey", character(), quiet = TRUE) | |
group_id <- 1414043 ## LA R meetup | |
req_url <- paste0("http://www.meetup.com/2/events?key=", api_key, | |
"&group_id=",group_id,"&status=past") | |
events_data <- fromJSON(rawToChar(GET(req_url)$content))$results |