This file contains hidden or 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> | |
<meta name="description" content="Drag Lock Exercise" /> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> | |
</head> | |
<body> | |
<div class="output"></div> | |
</body> | |
This file contains hidden or 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 CLICOLOR=1 | |
export LSCOLORS=cxgxCxDxBxegedabagacad | |
# Set git autocompletion and PS1 integration | |
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
. /usr/local/git/contrib/completion/git-completion.bash | |
fi | |
GIT_PS1_SHOWDIRTYSTATE=true |
This file contains hidden or 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 order_independent_equality_check = function(arr1, arr2, isEqual) { | |
if(arr1.length !== arr2.length) { return false; }; | |
isEqual = isEqual || function(a,b){return a === b;}; | |
var contains = function(arr, obj, equalityCheck, ignore_indicies) { | |
equalityCheck = equalityCheck || function(a,b){return a===b;}; | |
ignore_indicies = ignore_indicies || []; | |
for(var i = 0, len = arr.length; i<len; i++) { | |
var ignore = false; | |
for(var j = 0, lenj = ignore_indicies.length; j<lenj; j++) { | |
if(ignore_indicies[j] === i) { |
This file contains hidden or 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 order_independent_equality_check = function(arr1, arr2, isEqual) { | |
if(arr1.length !== arr2.length) { return false; }; | |
isEqual = isEqual || function(a,b){return a === b;}; | |
var contains = function(arr, obj, equalityCheck, ignore_indicies) { | |
equalityCheck = equalityCheck || function(a,b){return a===b;}; | |
ignore_indicies = ignore_indicies || []; | |
for(var i = 0, len = arr.length; i<len; i++) { | |
var ignore = false; | |
for(var j = 0, lenj = ignore_indicies.length; j<lenj; j++) { | |
if(ignore_indicies[j] === i) { |
This file contains hidden or 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 callback_map = function(arr, func, callback) { | |
var rv = []; | |
var waiting_for = arr.length; | |
arr.forEach(function(item, index) { | |
func(item, function(mapped) { | |
rv[index] = mapped; | |
waiting_for--; | |
if(waiting_for <= 0) { | |
callback(rv); | |
} |
This file contains hidden or 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 get_updater = function(do_update, update_interval) { | |
update_interval = update_interval || 20; | |
var calls = []; | |
var queue_update = function() { | |
var update_index = undefined; | |
for(var i = 0, len = calls.length; i<len; i++) { | |
if(calls[i].self === this) { | |
update_index = i; | |
break; |
This file contains hidden or 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 get_rounded_rectangular_shape = function(points, r) { | |
var sb; | |
if(r === 0) { | |
sb = new Array(3*(points.length+1)); | |
//Set up a move to and a line to the initial point | |
sb[0] = "M"; | |
sb[3*points.length] = "L"; | |
sb[1] = sb[3*points.length + 1] = points[0][0]; |