This file contains 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
Methodder = (method, scope) ->-> method.apply(scope, arguments) |
This file contains 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 rotationAnimation(elem, degrees, pointX, pointY, time){ | |
elem.animate({transform:"r"+[degrees,pointX,pointY]}, time); | |
} |
This file contains 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
// Do stuff after 100ms of no resizing | |
var resizeTimeout; | |
$(window).on("resize", function () { | |
clearTimeout(resizeTimeout); | |
resizeTimeout = setTimeout(function () { | |
// Do stuff | |
}, 100); | |
}); |
This file contains 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
// Ensure object obj[prop] = {} | |
function _obj(obj, prop) { | |
if (obj[prop] == null) obj[prop] = {} | |
return obj[prop] | |
} | |
// Ensure number obj[prop] (+= val or = val) | |
function _diff(obj, prop, val) { | |
if (obj[prop] == null) obj[prop] = val | |
else obj[prop] += val | |
} |
This file contains 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 swapContainers (name1, name2) { | |
var btn1 = $(".button-"+name1)[0] | |
var cont1 = $("#"+name1)[0] | |
var btn2 = $(".button-"+name2)[0] | |
var cont2 = $("#"+name2)[0] | |
var btn1CN = btn1.className | |
btn1.className = btn2.className.replace(name2, name1) | |
btn2.className = btn1CN.replace(name1, name2) | |
var cont1CN = cont1.className | |
cont1.className = cont2.className |
This file contains 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 coffee = require("coffee-script") | |
var vm = require("vm") | |
// Based on https://github.com/bevry/cson/blob/master/src/lib/cson.coffee | |
exports.parse = function (src, isJson) { | |
try { | |
result = JSON.parse(src) | |
} catch (err) { | |
if (isJson) | |
throw err | |
try { |
This file contains 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
# check out https://github.com/visionmedia/node-pwd | |
# Module dependencies. | |
crypto = require('crypto'); | |
# Bytesize. | |
len = 128; |
This file contains 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
doctype html | |
html | |
head | |
title= title | |
link(rel='stylesheet' href='/vendors/bootstrap-3.1.1/bootstrap.min.css') | |
link(rel='stylesheet' href='/css/style.css') | |
link(rel='stylesheet' href='/css/helpers.css') | |
block head | |
body | |
block content |
This file contains 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
coffee -o ./ -cbw ./ |
This file contains 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
cm_config = {} | |
cm_config['extraKeys'] = { | |
"Tab": checkToUseSpacesInsteadofTabs | |
} | |
CodeMirror($(".code")[0], cm_config) |
OlderNewer