Skip to content

Instantly share code, notes, and snippets.

@reinholdsson
reinholdsson / shellout.py
Created September 8, 2016 09:15 — forked from miku/shellout.py
shellout
def shellout(template, **kwargs):
"""
Takes a shell command template and executes it. The template must use
the new (2.6+) format mini language. `kwargs` must contain any defined
placeholder, only `output` is optional.
Raises RuntimeError on nonzero exit codes.
Simple template:
wc -l < {input} > {output}
@reinholdsson
reinholdsson / server.R
Created October 2, 2015 14:26 — forked from jpd527/server.R
Drag n drop list Shiny JS
library(shiny)
shinyServer(function(input, output,session) {
output$list <- renderUI({
sortListInput("sortable",c(test1="one",test2="two"))
})
})
@reinholdsson
reinholdsson / online_google_auth.r
Created September 29, 2015 14:32 — forked from MarkEdmondson1234/online_google_auth.r
Google OAuth2 Authentication functions for an R Shiny app
## GUIDE TO AUTH2 Authentication in R Shiny (or other online apps)
##
## Mark Edmondson 2015-02-16 - @HoloMarkeD | http://markedmondson.me
##
## v 0.1
##
##
## Go to the Google API console and activate the APIs you need. https://code.google.com/apis/console/?pli=1
## Get your client ID, and client secret for use below, and put in the URL of your app in the redirect URIs
## e.g. I put in https://mark.shinyapps.io/ga-effect/ for the GA Effect app,
@reinholdsson
reinholdsson / knit
Created November 12, 2013 18:42 — forked from baptiste/knit
#!/usr/bin/Rscript
require(knitr)
lf <- commandArgs(trailingOnly = TRUE)
if(!length(lf))
lf = list.files(pattern="\\.rmd")
for (f in lf)
try(knit(f))
md = paste0(sub("\\.[[:alnum:]]*$", "", lf), ".md")
@reinholdsson
reinholdsson / README.md
Created September 9, 2013 08:45 — forked from mbostock/.block

This bar chart visualizes hierarchical data using D3. Each blue bar represents a folder, whose length encodes the total size of all files in that folder (and all subfolders). Clicking on a bar dives into that folder, while clicking on the background bubbles back up to the parent folder. The effect is similar to a zoomable partition layout, though in a more conventional display.