Skip to content

Instantly share code, notes, and snippets.

View soldair's full-sized avatar

Ryan Day soldair

  • Google
  • San Jose CA
View GitHub Profile
@soldair
soldair / test.js
Created May 24, 2014 15:53
multiline strings with includes via function block comments
var foot = function(){
/*
<div>footer</div>
*/
}
var index = function fn(){
/*
<!DOCTYPE html>
<html>
@soldair
soldair / index.js
Created May 16, 2014 00:53
requirebin sketch
var bs = require('binary-search');
console.log(bs);
@soldair
soldair / package.json
Last active August 29, 2015 14:01
posting data to couch db from the pinoccio api
{
"name": "pinoccio-couch-example",
"description": "couch example for saving pinoccio stats",
"version": "0.0.0",
"repository": {
"url":"https://gist.github.com/c11d6ae6f4bead140838.git"
},
"main": "index.js",
"scripts": {
"test": "tape test/*.js"
@soldair
soldair / chipmunk_graph.html
Last active August 29, 2015 13:59
chipmunk graph!!
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Chipmunks!</h1>
<div id="graph">
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
@soldair
soldair / index.js
Last active August 29, 2015 13:59
requirebin sketch
var pinoccio = require('pinoccio');
var util = require('util');
var style = require('style-dom');
var term = require('hypernal')();
var url = require('url');
var colors = require('colors');
var parsed = url.parse(window.location.href,true);
var token = (parsed.query||{}).token||"e113fa4270ae050a0c706d29eca5ad25";
@soldair
soldair / keybase.md
Created March 17, 2014 23:30
keybase.md

Keybase proof

I hereby claim:

  • I am soldair on github.
  • I am soldair (https://keybase.io/soldair) on keybase.
  • I have a public key whose fingerprint is E225 9593 77B3 7C41 AF0E 9180 AEFB F862 B62A A835

To claim this, I am signing this object:

@soldair
soldair / utf8.js
Created January 28, 2014 00:53
utf8 js functions
var UTF8_MASK = [0x80,0xc0,0xe0,0xf0];
function utf8l(b){
if (!(b & 0x80)) {
return 1;
} else if ((b & 0xE0) === 0xC0){
return 2;
} else if ((b & 0xF0) === 0xE0) {
return 3;
@soldair
soldair / plan.md
Created January 19, 2014 15:58
managing pub subs as streams!

pressure-stream

  • call an async function. manage concurrency as backpressure.

pub-sub-duplex

@soldair
soldair / procfs-pipes.md
Last active January 3, 2016 15:09
procfs stats pipeline!!!!

i've exposed quite a few stats in my procfs-stats module. now i need to be able to make use of the data!

###poll-stream

###subtract-values-stream

@soldair
soldair / hmm.js
Last active December 25, 2015 17:19
wrap a pipe chain in an exposed through stream
var through = require('through')
module.exports = function(chain){
chain = chain();
var s = through(function(data){
if(!chain.write(data)) this.pause();
});
chain.on('drain',function(){
s.resume();
})