Skip to content

Instantly share code, notes, and snippets.

View zbjornson's full-sized avatar

Zach Bjornson zbjornson

View GitHub Profile
var buf1 = new Buffer(1024);
for (var i = 0; i < 1024; i++) {
buf1[i] = i
}
function toArrayBuffer(buffer) {
var ab = new ArrayBuffer(buffer.length);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
function flip() {
var flipper = new Uint8Array(4 * 10000);
flipFloat(flipper, 10000, 4);
}
function flipFloat(flipper, iMax, eSize) {
for (var i = 0; i < iMax; i += eSize) {
var t = flipper[i];
// Toggle this line:
if (t === undefined) {}
@zbjornson
zbjornson / pancakes.recipe
Created September 23, 2015 00:03
Protein pancakes
Version 1:
5 egg whites ┐
1 whole egg │
0.5 c flour │ combine all and cook
1 heaping scoop of vanilla Monster Milk ┘
http://www.bodybuilding.com/store/cs/monstermilk.html
Version 2:
1 c flour ┐
@zbjornson
zbjornson / index.html
Created April 29, 2012 08:49
D3 Slopegraph I
<!DOCTYPE html>
<html>
<head>
<title>Life Expectancy Slope Graph: 1960 &ndash; 2011</title>
<script src="http://mbostock.github.com/d3/d3.v2.min.js?2.8.1"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body { color: #444; background: #f3f3f3; font: normal 12px "Adobe Garamond Pro", "Palatino", serif; margin: 2em; }
header { margin: 0 0 20px 220px; border-bottom: 1px solid #6c6c6c; width: 360px; position: relative; }
h1 { font-size: 28px; font-weight: normal; text-shadow: #fff 0 1px 0; margin: 0 0 0 0; padding: 0; }
@zbjornson
zbjornson / index.html
Created May 2, 2012 02:13
D3 Slopegraph II
<!DOCTYPE html>
<html>
<head>
<title>Life Expectancy Slope Graph: 1960 &ndash; 2011</title>
<script src="http://mbostock.github.com/d3/d3.v2.min.js?2.8.1"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body { color: #444; background: #f3f3f3; font: normal 12px "Adobe Garamond Pro", "Palatino", serif; margin: 2em; }
header { margin: 0 0 20px 220px; border-bottom: 1px solid #6c6c6c; width: 360px; position: relative; }
h1 { font-size: 16px; font-weight: normal; text-shadow: #fff 0 1px 0; margin: 0 0 0 0; padding: 0; }
@zbjornson
zbjornson / output.R
Created October 5, 2012 03:37 — forked from mlinderm/output.R
Script for up-sampling additional FCS files - v1.1
#!/usr/bin/env Rscript
# Run this script in your SPADE analysis directory. You will need
# to copy some lines from your runSPADE.R file.
# Set the panel files as the vector of all the files, with the "parent" file as the reference_file.
PANELS <- list(
list(
panel_files=c("20071001-u937.002.fcs"),
median_cols=NULL,
@zbjornson
zbjornson / demo.java
Created October 12, 2015 19:36
Running arbitrary jobs in parallel on Google Dataflow
package demo.pipeline;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedList;
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@zbjornson
zbjornson / LICENSE
Last active December 20, 2015 08:39 — forked from dfm/LICENSE
Copyright (c) 2012–2013 Daniel Foreman-Mackey
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}
@font-face {
font-family: "xkcd";
src: url('http://antiyawn.com/uploads/Humor-Sans.ttf');
}