Skip to content

Instantly share code, notes, and snippets.

View kforeman's full-sized avatar

Kyle Foreman kforeman

View GitHub Profile
@kforeman
kforeman / chart-download.js
Created June 15, 2016 22:15
crowbar + png
// based off of:
// https://github.com/andyreagan/phantom-crowbar/blob/master/phantom-crowbar.js
// https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js
// and for a blog post about converting to png etc client side see
// http://willkoehler.net/2014/11/07/client-side-solution-for-downloading-highcharts-charts-as-images.html
function crowbar(svg) {
var source = '',
doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
prefix = {
xmlns: 'http://www.w3.org/2000/xmlns/',
using Eigen::SparseMatrix;
template<class Type>
SparseMatrix<Type> lcar_prior(size_t I, Type rho) {
// LCAR prior is:
// pW + (1-p)I
// where W[j,k] =
// n if j==k
// -1 if j~k
// 0 otherwise
@kforeman
kforeman / .block
Last active May 11, 2016 08:21
Labeled scatter
height: 560
{
"data": {
"record": [
{
"year": "1970",
"popTotal": "55928013",
"m": {
"mTotal": "27167319",
"rd": [
{
@kforeman
kforeman / shiny-server.MD
Created May 29, 2015 00:40
shiny-server install instructions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kforeman
kforeman / histogram.ipynb
Created May 7, 2014 21:52
map-reduce for efficient histograms in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.