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
// HeartBeat.ino | |
////////////////////////// | |
////////////////////////// | |
void PRIME_HEARTBEAT(byte BeatColor) | |
{ | |
byte CCSET; | |
int ColorSelection; | |
float in, out; |
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
//Re-writing Underscore and LoDash functions. | |
var forEach = function(collection, callback) { | |
for (var key in collection) { | |
callback(collection[key]); | |
} | |
}; | |
var map = function(collection, callback) { | |
var result = []; |
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 node = function(value, next, prev) { | |
this.data = value, | |
this.next = next, | |
this.prev = prev | |
}; | |
var LinkedList = function() { | |
this.head = null; | |
this.tail = null; | |
this.size = 0; |
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
/** Given an array, guarantee | |
* each element is shuffled once | |
* O(n) runtime | |
*/ | |
Array.prototype.shuffle = function() { | |
var remainingElements = this.length; | |
var helper; | |
var target; | |
while (remainingElements) { | |
target = Math.floor(Math.random()*remainingElements--); |
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
/** Define a walk_the_DOM function that visits every | |
* node of the tree in HTML source order, starting | |
* from some given node. It invokes a function, | |
* passing it each node in turn. walk_the_DOM calls | |
* itself to process each of the child nodes. | |
*/ | |
var walk_the_DOM = function walk(node, callback) { | |
callback(node); | |
node = node.firstChild; | |
while (node) { |
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
// Given an array with nested arrays, return a non-nested array. | |
function flatten(collection) { | |
var result = []; | |
var getValues = function(collection, result) { | |
for (var key in collection) { | |
if (!Array.isArray(collection[key])) { | |
result.push(collection[key]); | |
} else { | |
getValues(collection[key], result); |
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 debounce(callback, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this; | |
var args = arguments; | |
var delayedFire = function() { | |
timeout = null; | |
if (!immediate) callback.apply(context, args); | |
}; | |
clearTimeout(timeout); |
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
eval "$(rbenv init-)" | |
alias atm='open -a "Atom"' | |
alias prof='atm ~/.bash_profile' | |
alias dev='cd ~/Documents/shiphawk-dev' | |
alias dash='cd ~/Documents/dashboard-mvp' | |
alias hosts='sudo atm /private/etc/hosts' | |
alias elastic='elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml' | |
alias redis='redis-server /usr/local/etc/redis.conf' | |
alias rls-s='rails s' |
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 myCoffee = "HOT" | |
if (myCoffee === "HOT") { | |
/** always use "===" over "==". "===" is more strict than "==", so less errors. | |
* see http://stackoverflow.com/questions/523643/difference-between-and-in-javascript | |
*/ | |
console.log("Please proceed with caution"); | |
} else if (myCoffee === "IS NOT HOT") { | |
console.log("IT IS NOT HOT"); | |
} |
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
{ "extends": "eslint-config-airbnb", | |
"env": { | |
"browser": true, | |
"node": true, | |
"mocha": true | |
}, | |
"rules": { | |
"react/no-multi-comp": 0, | |
"import/default": 0, | |
"import/no-duplicates": 0, |
OlderNewer