$ 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
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
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
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
// Validation method for US currency | |
$.validator.addMethod("currency", function (value, element) { | |
return this.optional(element) || /^\$(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/.test(value); | |
}, "Please specify a valid amount"); |
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 getDecimalLimit2(mnt) { | |
return (Math.round(mnt * 100)) / 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
function isEmpty(val) { | |
return (!/\S/.test(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
// Jonathan's placeholder polyfill | |
// *Requires jQuery | |
(function () { | |
function PlaceholderDefaults() { | |
return { | |
'placeholderText': '', | |
'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
/** | |
* Get the current date and the date 30 days ago. | |
* Then format the dates like this: M/D/YYYY. | |
*/ | |
var diff = 2592000000; | |
var now = new Date(); | |
var diffDate = new Date( now.getTime() - diff ); | |
var nowPrint = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ].join("/"); | |
var diffPrint = [ diffDate.getMonth() + 1, diffDate.getDate(), diffDate.getFullYear() ].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
function scrollDown( options ) { | |
var settings, winHeight, elementTop; | |
// override settings by passing in the options object | |
settings = $.extend({ | |
'offset': 70, | |
'selector': 'footer', | |
'speed': 'fast' | |
}, options); |