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
onerror = (err, file, line) -> | |
logger """ # console.log, alert, whatever | |
The following error occured: #{err} | |
In file: #{file} | |
At line: #{line} | |
""" |
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
#!/bin/bash | |
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz" | |
tar -xf libevent-2.0.21-stable.tar.gz | |
./configure | |
make | |
make verify | |
sudo make install |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
"use strict"; | |
define(function () { |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
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
/* | |
* Set up factories, then create them in tests with (for example): | |
* | |
* LineItemFactory(); | |
* | |
* Or with attributes / overrides: | |
* | |
* LineItemFactory({ | |
* "id": 123, | |
* "order": OrderFactory({"firstName": "Example Associated Record Override"}), |
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 times = { | |
Schedule: { | |
"2014-09-26T00:00:00": [1,23], | |
"2014-09-27T00:00:00": [9,14] | |
} | |
}; | |
function formatHour(hour) { | |
return hour > 12 ? |
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
$(document).ready(function(){ | |
countdown(); | |
setInterval(countdown, 1000); | |
function countdown () { | |
var now = moment(), // get the current moment | |
// May 28, 2013 @ 12:00AM | |
then = moment([2013, 4, 28]), | |
// get the difference from now to then in ms | |
ms = then.diff(now, 'milliseconds', true); | |
// If you need years, uncomment this line and make sure you add it to the concatonated phrase |
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 delta; | |
dragThreshold = 0.15;// "percentage" to drag before engaging | |
dragStart = null; // used to determine touch / drag distance | |
percentage = 0, | |
target, | |
previousTarget; | |
function touchStart(event) { | |
if (dragStart !== null) { return; } |
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 delta; | |
var currentSlideIndex = 0; | |
function elementScroll (e) { | |
// --- Scrolling up --- | |
if (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0) { | |
delta--; |
OlderNewer