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
function mergeSorted(a,b){ | |
var alen = a.length | |
, blen = b.length | |
, i, j, k = j = i = 0 | |
, answer = new Array(alen + blen) | |
;//var | |
while(i < alen && j < blen) | |
answer[k++] = a[i] < b[j] ? a[i++] : b[j++]; | |
while(i < alen) answer[k++] = a[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
class Homer < RTanque::Bot::Brain | |
NAME = 'Homer' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
skateboard | |
slingshot | |
mmmmmmmmmmmmmmmmmm_donuts | |
if someones_trying_to_steal_my_donut |
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
void clearAndHome() | |
{ | |
Serial.write(27); | |
Serial.print("[2J"); // clear screen | |
Serial.write(27); // ESC | |
Serial.print("[H"); // cursor to home | |
} |
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
function slice(obj){return Array.prototype.slice.call(obj)} | |
var containers = slice(document.querySelectorAll('.category-container')); | |
containers.forEach(function(ele){ | |
var work = ele.querySelectorAll('.category')[0].innerHTML.match(/Work/); | |
var gather = []; | |
if(work){ | |
slice(ele.querySelectorAll('.summaryShadow')).forEach(function(e){ | |
gather.push(e.innerText); |
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
/** | |
* Creates two functions on the window object: | |
* - addEvent | |
* - removeEvent | |
* | |
* @author THEtheChad | |
*/ | |
/** | |
* attachEvent: Binds an event handler to the given element |
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
(function(window){ | |
var styles = window.getComputedStyle(document.documentElement, '') | |
, pre = (Array.prototype.slice | |
.call(styles) | |
.join('') | |
.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']) | |
)[1] | |
, dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1] | |
, capitalize = function(str){ return str.charAt(0).toUpperCase() + str.substring(1) } |
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
Array.prototype.slice.call(document.querySelectorAll('[type="checkbox"]')).forEach(function(box){box.checked = 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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
function permute(set, digits, prefix){ | |
if(!prefix) prefix = ''; | |
if(--digits){ | |
var i = set.length; | |
while(i--){ | |
permute(set, digits, prefix + set[i]) | |
} | |
} | |
else{ |
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
build_event: function buildEvent(id, callback){ | |
var mungeData | |
, responses = [] | |
, path = '/events/' + id | |
, workers = [ | |
'', | |
'/stats', | |
'/roster', | |
'/votes', | |
'/attendees' |