Skip to content

Instantly share code, notes, and snippets.

View yihui's full-sized avatar

Yihui Xie yihui

View GitHub Profile
@yihui
yihui / server.R
Last active December 18, 2015 19:48 — forked from jcheng5/server.R
xy = matrix(0.5, 1, 2)
shinyServer(function(input, output) {
output$myplot = renderPlot({
hover = input$myplot_hover
if (!is.null(hover))
xy <<- rbind(xy, c(hover$x, hover$y))
par(mar = rep(0, 4))
plot.new()
points(xy, pch = rep(c(21, 19), c(nrow(xy) - 1, 1)))
box()
@yihui
yihui / github-upload
Created May 1, 2012 16:05 — forked from wereHamster/README.md
Script to upload files to github: ./github-upload <file> [<repo>]
#!/usr/bin/env ruby
# under Ubuntu, you should install ruby1.9.1 or higher (default 1.8 does not work)
require 'json'
require 'net/https'
require 'pathname'
# Extensions