$ git tag
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 args = process.argv.slice(2); | |
var total = 0; | |
for (var i = 0, len = args.length; i < len; i++) { | |
total += Number(args[i]); | |
} | |
console.log(total); |
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 pad(num) { | |
return (num < 10 ? '0' : '') + num; | |
} | |
function formatDateMonthDayYear(date) { | |
if (date) { | |
date = new Date(date); | |
} else { | |
date = new Date(); | |
} |
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 reverseIt(str) { | |
return str.split('').reverse().join(''); | |
} |
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 _ = _ || {}; | |
_.contains = function (obj, target) { | |
if (obj == null) return false; | |
if (Array.prototype.indexOf && obj.indexOf === Array.prototype.indexOf) return obj.indexOf(target) != -1; | |
return obj.some(function(value) { | |
return value === target; | |
}); | |
}; |
This is a template for creating Bootstrap pagination with Backbone.js and backbone.paginator.
Based on the Digg-Style Pagination script for PHP.
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
$.fn.checkbox = function () { | |
return this.find('input[type="checkbox"]'); | |
}; |
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 query( key ) { | |
if ( location.href.indexOf("?") !== -1 ) { | |
var q = location.search, | |
p = [], | |
i, val; | |
q = q.slice(1); | |
if ( q.indexOf("&") !== -1 ) { | |
q = q.split("&"); | |
for ( i=0; i < q.length; i++ ) { | |
p.push( q[i].split("=") ); |
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
<a href="javascript:(function(){if(localStorage.length){for(var i=0;i<localStorage.length;i++){console.log(localStorage.key(i)+':'+localStorage.getItem(localStorage.key(i)));}}})();">Check localStorage</a> |
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
if ( localStorage.length ) { | |
for ( var i=0; i < localStorage.length; i++ ) { | |
console.log( localStorage.key(i) + ":" + localStorage.getItem( localStorage.key(i) ) ); | |
} | |
} |
OlderNewer