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
<snippet> | |
<content><![CDATA[/** @jsx React.DOM */]]></content> | |
<tabTrigger>jsx</tabTrigger> | |
<scope>source.js</scope> | |
<description>jsx declerations</description> | |
</snippet> |
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
{ | |
"HarleyKwyn": [''shortly-hapi','famous2048', 'barista', 'GalaxyQuestWebsite', 'SSAASS'] | |
} |
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 nthFibonacci = function(n) { | |
// Your code here | |
return n < 2 ? n : nthFibonacci(n-1) + nthFibonacci(n-2); | |
}; | |
var result = nthFibonacci(4) |
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 treeMaker = function(value){ | |
//tree code goes here! | |
var tree = Object.create(treeMaker.methods); | |
tree.value = value || null; | |
tree.children = []; | |
return tree; | |
}; | |
//methods go here! |
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 choose = function(list){ | |
return list[Math.floor(list.length * Math.random())]; | |
}; | |
var aHero = function(){ | |
return choose(heroList); | |
}; | |
var aDeed = function(){ | |
return choose(deedList); |
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 longestPalindrome = function (string) { | |
// Your code here | |
// Sliding window problem. | |
// If string is palindrom, return string | |
// else check if substring of length stringLength-n is palindrome. | |
// As soon as you get a palindrome you've found the longest palindrome | |
// since you're shrinking the window and you want the longest one. | |
var stringLength = string.length | |
var n = 0; | |
while( n < stringLength){ |
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
/** | |
* A prime number is a whole number that has no other divisors other than | |
* itself and 1. Write a function that accepts a number and returns true if it's | |
* a prime number, false if it's not. | |
*/ | |
var primeTester = function(n) { | |
if( n === 1) return false; |
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 bubbleSort = function(array){ | |
for(var i = 0; i < array.length-1 ; i++){ | |
for(var j = 0; j < array.length-1 ; j++ ){ | |
if(array[j]>array[j+1]){ | |
var swap = array[j]; | |
array[j] = array[j+1]; | |
array[j+1] = swap; | |
} | |
} | |
} |
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 trampoline = function(fun){ | |
var args = Array.prototype.slice.call(arguments,1); | |
var result = fun.apply(this, args); | |
while(typeof result === 'function') { | |
result = result(); | |
} | |
return result; | |
}; | |
var countDown = function(n){ |