Skip to content

Instantly share code, notes, and snippets.

View jcheng5's full-sized avatar

Joe Cheng jcheng5

View GitHub Profile
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Basic DataTable
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: mtcars selectinput datatables
Type: Shiny
# Define a dataset globally which will be available
# both to the UI and to the server.
# Rely on the 'WorldPhones' dataset in the datasets
# package (which generally comes preloaded).
library(datasets)
# Trim out the non-consecutive year from
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Telephones by region
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: sidebarlayout helptext selectinput
Type: Shiny
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Dynamic Clustering
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: mclust clustering clickid observe isolate
Type: Shiny
@jcheng5
jcheng5 / Shell log.sh
Created June 5, 2012 07:02 — forked from acdha/Shell log.sh
Contortions needed to create an AWS RDS database using UTF-8
brew install rds-command-line-tools
rds-create-db-parameter-group mysql-utf8 -f mysql5.1 -d "MySQL 5.1 configured for UTF-8"
rds-modify-db-parameter-group mysql-utf8 \
--parameters="name=character_set_server, value=utf8, method=immediate" \
--parameters="name=character_set_client, value=utf8, method=immediate" \
--parameters="name=character_set_results,value=utf8,method=immediate" \
--parameters="name=collation_server, value=utf8_general_ci, method=immediate" \
--parameters="name=collation_connection, value=utf8_general_ci, method=immediate"
library(shiny)
shinyServer(function(input, output) {
re <- reactive(function(){
cat("re called\n",file=stderr())
input$n
})
output$ntext <- reactiveText(function() {
cat("output$ntext called\n",file=stderr())
@jcheng5
jcheng5 / app.R
Last active November 19, 2015 19:55 — forked from klittle314/app.R
Test Shiny app: submit and clear
#test app to load the form and clear it for second record entry
#Kevin Little, Ph.D. 18 Nov 2015
require(shiny)
require(shinyapps)
require(shinyjs)
#local df taking the place of a Google sheet
df1 <- data.frame(name="name1", stringsAsFactors = FALSE)
@jcheng5
jcheng5 / server.r
Last active December 10, 2015 13:18
# Some pre-computed stuff in R. In this example, just assign values to a var
# data_sets <- c("mtcars", "morley", "rock")
data_sets <- c("mymtcars","mtcars", "morley", "rock")
mymtcars <- mtcars[,1:4]
shinyServer(function(input, output) {
mymtcars <- mymtcars
<script src="https://github.com/livereload/livereload-js/raw/master/dist/livereload.js?host=localhost"></script>