Crude implementation of ACO in D3js, based on the awesome work of Joel Wenzel et al.
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 indexOfNearestLessThan(array, needle) { | |
if (array.length === 0) return -1; | |
var high = array.length - 1, | |
low = 0, | |
mid, | |
item, | |
target = -1; | |
if (array[high] < needle) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://raw.githubusercontent.com/jakiestfu/Medium.js/master/medium.js"></script> | |
<link href="https://raw.githubusercontent.com/jakiestfu/Medium.js/master/medium.css" type="text/css"/> | |
<style> | |
.green { | |
background-color: green; | |
} | |
</style> |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>Medium.js with an Iframe</title> | |
<script src="bower_components/undo/undo.js"></script> | |
<script src="bower_components/rangy-official/rangy-core.min.js"></script> | |
<script src="bower_components/rangy-official/rangy-classapplier.min.js"></script> | |
<script src="medium.js"></script> | |
<link href="medium.css" rel="stylesheet"> |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>Medium.js to make an Anchor</title> | |
<script src="bower_components/undo/undo.js"></script> | |
<script src="bower_components/rangy-official/rangy-core.min.js"></script> | |
<script src="bower_components/rangy-official/rangy-classapplier.min.js"></script> | |
<script src="medium.js"></script> | |
<link href="medium.css" rel="stylesheet"> |
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
var div = $('<div>') | |
.appendTo('body') | |
.append(tableify(' \t \t \t \t \n\ | |
\t \t \t \t \n\ | |
\t \t \t \t \n\ | |
\t \t \t \t \n\ | |
\t \t \t \t \n')) | |
.append(tableify(' \t \t \t \t \n\ | |
\t \t \t \t \n\ | |
\t \t \t \t \n\ |
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
//depends on https://github.com/padolsey/operative | |
var jsonThreadedStreamer = (function (operative) { | |
var i = 0, | |
threads = []; | |
function thread() { | |
var t = threads[i], | |
limit = thread.limit; |
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
var XMLHttpRequest = window.XMLHttpRequest; | |
function RequestListener(objParameters) { | |
var self = this | |
, realRequest = this.realRequest = new XMLHttpRequest(objParameters) | |
; | |
realRequest.onload = function() { | |
if (self.onload) { | |
self.onload.apply(realRequest, arguments); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Many polygons with leaflet, earcut and WebGL</title> | |
<meta charset="utf-8"> | |
<style> | |
html, body { | |
height: 100%; | |
padding: 0; |
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
var fs = something(require('fs')); | |
fs.readFile('') | |
.then(function(str) {}) | |
.then(function() {}) | |
.done(function() {}) | |
.error(function (err) { | |
//this is an optional fn that is already defined to throw the error, but can be overridden |
OlderNewer