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
import Html exposing (text) | |
import List | |
{- Challenge: flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
(This is a little tricky in Elm because the type system does not allow for lists with different element types. So we have to make a whole new data structure...) | |
-} | |
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
# My functional implementation of the common "fizzbuzz" interview coding test | |
FIZZBUZZMAP = [null, "fizz", "buzz", "fizzbuzz"] | |
isDivisibleBy = (d) -> | |
(n) -> !(n%d) | |
isFizz = isDivisibleBy 3 | |
isBuzz = isDivisibleBy 5 |
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
#!/bin/sh | |
clear | |
git checkout $(git rev-list HEAD..master | tail -n 1) | |
pbcopy < game.js | |
git show --format="%C(yellow)%s%Creset%n%n%b" |
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
nodemon -w . -e ".coffee" -x "bash" build |
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
// functional util to make a function time itself | |
function makeTimedFunction(fn, lable) { | |
return function(){ | |
console.time(lable || 'time to complete '+fn.name); | |
var results = fn.apply(fn,Array.prototype.slice.call(arguments)); | |
console.timeEnd(lable || 'time to complete '+fn.name); | |
return results; | |
}; | |
} |
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
"AdvancedNewFile", | |
"Clipboard History", | |
"CoffeeScript", | |
"Jade", | |
"JavaScript Refactor", | |
"JsFormat", | |
"Package Control", | |
"Pretty JSON", | |
"SASS Build", | |
"Stylus", |
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
[ | |
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context": | |
[ | |
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\"'\\]]", "match_all": true }, | |
{ "key": "auto_complete_visible", "operator": "equal", "operand": false } | |
] | |
}, | |
{ "keys": ["alt+up"], "command": "move_caret_top" }, | |
{ "keys": ["alt+command+up"], "command": "move_caret_back", "args": { "nlines": 10} }, | |
{ "keys": ["alt+command+down"], "command": "move_caret_forward", "args": { "nlines": 10} }, |
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
{ | |
"font_size": 14.0, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"word_wrap": 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 elems=document.querySelectorAll("body *"); | |
var l=elems.length; | |
var i, c, move, x = 1; | |
var A = function (){ | |
for(i=0; i-l; i++){ | |
c=elems[i].style; | |
move = elems[i].move | |
if (!move){ | |
move=(Math.random()*8*(Math.round(Math.random())?1:-1)); | |
} |
NewerOlder