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
# Periodically call the condition promise, resolves when the condition resolves | |
poll = (condition, interval=1000, timeout=60000)-> | |
promise = Q.promise (resolve, reject)-> | |
start = _.now() | |
test = -> | |
_duration = _.now() - start | |
if _duration > timeout | |
reject "Polling timeout of #{ timeout }ms exceeded." | |
else | |
Q.fcall(condition).then resolve |
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
// define ds, which adds to a queue | |
// must be included in <head>, before anything else. | |
function ds(){ | |
(ds.q = ds.q || []).push(arguments); | |
return ds; | |
} | |
// process queue, included at the end of vendored js | |
function run(args){ | |
var module = args[0](); |
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 ids = $('.thumbs').map(function(){ | |
var $thumb = $(this); | |
return $thumb.data('release_id'); | |
}); | |
$.ajax(yourOptionsIncludingIds) |
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
// Media Queries in Sass 3.2 | |
// | |
// These mixins make media queries a breeze with Sass. | |
// The media queries from mobile up until desktop all | |
// trigger at different points along the way | |
// | |
// And important point to remember is that and width | |
// over the portrait width is considered to be part of the | |
// landscape width. This allows us to capture widths of devices | |
// that might not fit the dimensions exactly. This means the break |
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
alert('not secure'); |
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 unique(array){ | |
var unique = []; | |
for (var i = 0, l = array.length; i < l; i++){ | |
if (unique.indexOf(array[i]) === -1) | |
unique.push(array[i]); | |
} | |
return unique; | |
} |
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
@media (min--moz-device-pixel-ratio: 1.5), | |
(-o-min-device-pixel-ratio: 3/2), | |
(-webkit-min-device-pixel-ratio: 1.5), | |
(min-device-pixel-ratio: 1.5), | |
(min-resolution: 144dpi), | |
(min-resolution: 1.5dppx) { | |
/* Retina rules! */ | |
} |
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
{ | |
"my_custom_field_data": { "omg": "bar" } | |
} |
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
window.exports={}; | |
window.imported={}; | |
// synchronous require for CommonJS | |
function require(name){ | |
if (!window.imported[name]){ | |
var xhrObj = createXMLHTTPObject(); | |
// open and send a synchronous request | |
xhrObj.open('GET', name + ".js", false); | |
xhrObj.send(''); |
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 test = 'test!'; |