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:
| ((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)) |
| //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); | |
| }; |
I hereby claim:
To claim this, I am signing this object:
| //------------------------------------------ | |
| //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); | |
| }; |
| Compiling crafty chess on MacOS, you get the following error: | |
| ------------------------------------------------------------- | |
| ~/apps/crafty/crafty-23.4:$ make darwin | |
| /Applications/Xcode.app/Contents/Developer/usr/bin/make target=FreeBSD \ | |
| CC=gcc CXX=g++ \ | |
| CFLAGS='-Wall -pipe -O3' \ | |
| CXFLAGS='-Wall -pipe -O3' \ | |
| LDFLAGS= \ | |
| LIBS='-lstdc++' \ | |
| opt='' \ |
| /* | |
| 2D ARRAY | |
| 0 1 2 3 4 (x) | |
| 0 [ ][ ][ ][ ][ ] | |
| 1 [ ][ ][#][ ][ ] | |
| 2 [ ][ ][ ][ ][ ] | |
| 3 [ ][ ][ ][ ][ ] | |
| 4 [ ][ ][ ][ ][ ] |
| /********************************* | |
| * | |
| * Elo Rating Simulation | |
| * Copyright (c) 2013, Max Irwin | |
| * MIT License | |
| * | |
| *********************************/ | |
| (function(){ | |
| var players = []; |
| //MIT License | |
| //Copyright (c) 2013, Max Irwin | |
| //Parses a CIDR Range into beginning and ending IPv4 Addresses | |
| //For example: '10.0.0.0/24' | |
| //Returns ['10.0.0.0', '10.0.0.255'] | |
| var parseCIDR = function(CIDR) { | |
| //Beginning IP address | |
| var beg = CIDR.substr(CIDR,CIDR.indexOf('/')); |
| //From https://code.google.com/p/chromium/issues/detail?id=69227#c37 | |
| //take apart data URL | |
| var parts = canvas.toDataURL().match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/); | |
| //assume base64 encoding | |
| var binStr = atob(parts[3]); | |
| //convert to binary in ArrayBuffer | |
| var buf = new ArrayBuffer(binStr.length); |
| //MIT License | |
| //Author: Max Irwin, 2011 | |
| //Floodfill functions | |
| function floodfill(x,y,fillcolor,ctx,width,height,tolerance) { | |
| var img = ctx.getImageData(0,0,width,height); | |
| var data = img.data; | |
| var length = data.length; | |
| var Q = []; | |
| var i = (x+y*width)*4; |