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
const alphabet = (function() { | |
letters = [...Array(26)].map((value, index) => String.fromCharCode(index + 65)) | |
return letters.map(letter => { | |
return { lower: letter.toLowerCase(), upper: letter.toUpperCase() } | |
}) |
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
# Credit: http://gist.github.com/399624 | |
# The click event will be fired with a small delay but will not fire upon a double click. | |
$.fn.clickSingleDouble = (singleClickCallback, doubleClickCallback, delay = 250) -> | |
return this.each => | |
clicks = 0 | |
$(this).click (event) => |
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
localKeys = -> | |
return Object.keys window.localStorage | |
localWrite = (key, value) -> | |
try | |
window.localStorage.setItem String(key), JSON.stringify(value) |
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
# Rotate any jQuery selected element. | |
# Credit: https://gist.github.com/hoandang/5989980 | |
# Credit: https://stackoverflow.com/a/15191130/1544937 | |
$.fn.rotate = (degree = 0, duration = 1000) -> | |
element = $(this) | |
rotation = -> | |
matrix = element.css "-webkit-transform" or |