Skip to content

Instantly share code, notes, and snippets.

View benjaminmbrown's full-sized avatar
💭
Visit Chainwave.io

Benjamin Michael Brown benjaminmbrown

💭
Visit Chainwave.io
View GitHub Profile

Keybase proof

I hereby claim:

  • I am benjaminmbrown on github.
  • I am benjaminmbrown (https://keybase.io/benjaminmbrown) on keybase.
  • I have a public key ASAGAClVrM83UIwjBYhgQxT9ZkQEru1c0QWVct3nxdN5Jgo

To claim this, I am signing this object:

@benjaminmbrown
benjaminmbrown / package.json
Created June 27, 2018 00:48
Working Mac package.json for Truffle's Drizzle box
{
"name": "drizzle-box",
"version": "1.0.0",
"devDependencies": {
"autoprefixer": "6.5.1",
"babel-core": "6.17.0",
"babel-eslint": "7.1.1",
"babel-jest": "17.0.2",
"babel-loader": "6.2.7",
"babel-preset-react-app": "^2.0.1",
/*pseudocode for event demultplexer*/
socketA, pipeB;
watchedList.add(socketA, FOR_READ);
watchedList.add(pipeB, FOR_READ);
while(events = demultiplexer.watch(watchedList){
foreach(event in events){
/*non blocking read always returns data*/
data = event.resource.read();
#pseudo code for simple non-blocking I/O with polling loop (busy-wait)
resources = [socketA, socketB, pipeA];
while(!resources.isEmpty()){
for(i = 0; i< resources.length; i++){
resource = resources[i];
//attempt to read resource
var data = resource.read();
if(data === NO_DATA_AVAILABLE)
continue
@benjaminmbrown
benjaminmbrown / connection-onmessage.js
Created February 23, 2016 06:15
connection-onmessage.js
connection.onmessage = function(event) {
var newData = JSON.parse(event.data);
var updateObject =[{
"Name": newData.Name,
"Year": newData.Year,
"Spent": newData.Spent,
"payType": newData.payType
}]
//resetData(ndx, [yearDim, spendDim, nameDim]);
xfilter.add(updateObject);
function render_plots(){
yearRingChart
.width(200).height(200)
.dimension(yearDim)
.group(spendPerYear)
.innerRadius(50);
spenderRowChart
.width(250).height(200)
.dimension(nameDim)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dimensional Charting</title>
<link rel="stylesheet" type="text/css" href="http://dc-js.github.io/dc.js/css/dc.css"/>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/d3.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/crossfilter.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/dc.js"></script>
@benjaminmbrown
benjaminmbrown / datavis-static.html
Last active February 23, 2016 05:54
static d3 & crossfilter chart solution
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dimensional Charting</title>
<link rel="stylesheet" type="text/css" href="http://dc-js.github.io/dc.js/css/dc.css"/>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/d3.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/crossfilter.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/dc.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dimensional Charting</title>
<link rel="stylesheet" type="text/css" href="http://dc-js.github.io/dc.js/css/dc.css"/>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/d3.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/crossfilter.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/dc.js"></script>
<html>
<head>
<meta charset="utf-8">
<title>Dimensional Charting</title>
<link rel="stylesheet" type="text/css" href="http://dc-js.github.io/dc.js/css/dc.css"/>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/d3.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/crossfilter.js"></script>
<script type="text/javascript" src="http://dc-js.github.io/dc.js/js/dc.js"></script>
</head>