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
exports.eachSlice = function(object, size){ | |
var index = - size, | |
slices = []; | |
while ((index += size) < object.length) { | |
slices.push(object.slice(index, index + size)); | |
} | |
return slices; | |
}; |
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
// nano-router | |
// callback will be called whenever hash is changed | |
var router = function(cb, t) { | |
var w = $(window).on('hashchange', function() { | |
var params = location.hash.split('/').slice(1); | |
cb.apply(null, params); | |
}); | |
if (t) w.trigger('hashchange'); | |
}; |
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
{ | |
"name": "scrll", | |
"version": "0.5.0", | |
"authors": [ | |
"eyy <[email protected]>" | |
], | |
"dependencies": { | |
"jquery" : "*" | |
}, | |
"description": "animated scroll to an element", |
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
// fit element contents to its width | |
(function($) { | |
$.fn.fitter = function() { | |
this.each(function() { | |
var el = $(this).css({ | |
//'overflow-x': 'hidden', | |
'white-space': 'nowrap' | |
}), | |
fitter = el.wrapInner('<fitter />').children('fitter').css({ | |
display: 'inline-block' |
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
/* | |
$('form').serializeObject() get form data as an object | |
$('form').formJSON(callback) send form as ajax | |
example: | |
$('form[data-json]').formJSON(function(res) { | |
$('h3.message').text(res.message); | |
}); | |
*/ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<TaskOptions> | |
<TaskOptions> | |
<option name="arguments" value="C:\projects\Sentr\server\compile_templates.js" /> | |
<option name="checkSyntaxErrors" value="true" /> | |
<option name="description" value="" /> | |
<option name="exitCodeBehavior" value="ERROR" /> | |
<option name="fileExtension" value="tl" /> | |
<option name="immediateSync" value="true" /> | |
<option name="name" value="dust templates" /> |
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
// add class, remove it at animation end. also callback | |
$.fn.animateClass = function(cls, cb) { | |
if (typeof cb === 'string') { | |
var endClass = cb; | |
cb = function() { $(this).addClass(endClass); }; | |
} | |
return $(this).one('webkitAnimationEnd', function() { | |
$(this).removeClass(cls); | |
if (cb) cb.call(this); |
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
/**package | |
{ | |
"name": "mailson", | |
"description": "Mailing for kids", | |
"version": "0.1.0", | |
"author": { | |
"name": "Etay Perez", | |
"email": "[email protected]" | |
}, | |
"dependencies": { |
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
dust.helpers.first = function(chunk, context, bodies) { | |
if (context.stack.index == 0) | |
return chunk.render(bodies.block, context); | |
else if (bodies['else']) | |
return chunk.render(bodies['else'], context); | |
else | |
return chunk; | |
}; |
OlderNewer