This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------ | |
//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); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export NEURAL_HOST=$1 | |
if [ -z "$1" ] | |
then | |
export NEURAL_HOST=localhost | |
fi | |
node load_icecat.js --name icecat --files vectors/icecat.jsonl/ --host $NEURAL_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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('/')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------- | |
//Gets the querystring value for the specified key | |
$.querystring = (function(key,url){ | |
url = url || window.location.search; | |
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); | |
var results = regex.exec( url ); | |
return (!results)?"":decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}).bind($); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Admins-MacBook-Pro:apps max$ git clone https://github.com/SeaseLtd/rated-ranking-evaluator | |
Cloning into 'rated-ranking-evaluator'... | |
remote: Enumerating objects: 4224, done. | |
remote: Total 4224 (delta 0), reused 0 (delta 0), pack-reused 4224 | |
Receiving objects: 100% (4224/4224), 27.38 MiB | 11.37 MiB/s, done. | |
Resolving deltas: 100% (1204/1204), done. | |
Admins-MacBook-Pro:apps max$ cd rated-ranking-evaluator/ | |
Admins-MacBook-Pro:rated-ranking-evaluator max$ ls | |
CONTRIBUTING.md README.md rre-maven-archetype rre-server | |
LICENSE.md pom.xml rre-maven-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Max Irwin http://www.binarymax.com | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); |
NewerOlder