View module.exports.js
;(function(global){
global.module = {};
global.require = function(){};
Object.defineProperty(global.module,'exports',{
set:function(m) {
if (typeof m === 'function') {
var str = m.toString();
var name = str.substring(9,str.indexOf('(')).replace(/\s+/,'');
global[name] = m;
} else if (typeof m === 'object') {
View md2html.js
#!/usr/bin/env node
var fs = require('fs');
var cm = require('commonmark');
var convert = function(markdown) {
var reader = new cm.Parser();
var writer = new cm.HtmlRenderer();
var parsed = reader.parse(markdown);
var result = writer.render(parsed);
return result;
View getComputedColor.js
(function(){
var getColor = function(c) {
var temp = document.createElement("div");
var color = {r:0,g:0,b:0,a:0};
temp.style.color = c;
temp.style.display = "none";
document.body.appendChild(temp);
var style = window.getComputedStyle(temp,null).color;
document.body.removeChild(temp);
View word2vec_hn_classifications_1.txt
startups(0.265) | Previously: https://news.ycombinator.com/item?id=9990221
religion(0.227) | Out of curiosity, why secular humanism vs existential nihilism? I don't think I'll switch sides and time soon, but if I did it would be to nihilism.
education(0.245) | Education and Healthcare: Two services which should not be offered by businesses seeking to make a profit. I think future generations will look back and ask: "What were they thinking?"
religion(0.203) | Also if the opposite sex thinks you're gay but you're straight, it's harder to attract them.
View hn2vec.out
Starting training using file 10m.txt
Vocab size: 305432
Words in train file: 565170189
Alpha: 0.000045 Progress: 99.91% Words/thread/sec: 107.57k
real 174m19.955s
user 1315m35.661s
sys 3m27.011s
---------------------------
View hn2vec.js
#!/usr/bin/env node
var linestream = require('line-stream');
var htmldecode = require('htmldec');
var s = linestream();
var numbers = "zero,one,two,three,four,five,six,seven,eight,nine".split(',');
var reletter = /[a-z_]/i;
var renumber = /[0-9]/;
var reclose = /\<\/[^\>]+\>/g;
View TheListServeSolution.js
((function(f){"use strict";var bdy=window.top.document.body;bdy.innerHTML="";bdy.style.backgroundRepeat="repeat";var c=document.createElement("canvas");var d=c.getContext('2d');var e="";c.width=f;c.height=f;var g=d.createImageData(f,f);var h=[f*f];var i=[];var j=function(z){var a=g.data;for(var x=0;x<f;x++){for(var y=0;y<f;y++){var b=(x+y*f)*4;a[b+0]=(h[b].r*z)%255;a[b+1]=(h[b].g*z)%255;a[b+2]=(h[b].b*z)%255;a[b+3]=255}}d.putImageData(g,0,0);e=c.toDataURL();i.push('url('+e+')')};var k=0,dir=1;var l=function(){bdy.style.backgroundImage=i[k];k+=dir;if(k===f)dir=-1;if(k===0)dir=1};for(var x=0;x<f;x++){for(var y=0;y<f;y++){var m=(x+y*f)*4;h[m]={r:parseInt((x^y)),g:parseInt((x|y)),b:parseInt((x&y))}}}for(var z=0;z<f;z++){j(z)}setInterval(l,200)})(300))
View GUID.js
//Easy 8 char Base-36 GUID
var GUID = function() {
var char = function(){return Math.floor(Math.random()*36).toString('36')};
return char() + char() + char() + ((new Date())-0).toString('36').substr(3);
};
View keybase.md

Keybase proof

I hereby claim:

  • I am binarymax on github.
  • I am binarymax (https://keybase.io/binarymax) on keybase.
  • I have a public key whose fingerprint is F29D 3138 8A07 0E93 3EB1 0FF6 3231 DE37 8B23 41B5

To claim this, I am signing this object:

View Bitmap.js
//------------------------------------------
//Compact bitmap datastructure
//Memory efficient array of bool flags
var Bitmap = function(size){
this._cols = 8;
this._shift = 3;
this._rows = (size>>this._shift)+1;
this._buf = new ArrayBuffer(this._rows);
this._bin = new Uint8Array(this._buf);
};