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
Date.prototype.addMins = function(mins) { | |
var dat = new Date(this.valueOf()); // make a new date coz we can't change the original | |
dat.setMinutes(dat.getMinutes() + mins*1); // force mins to be integer instead of string | |
return dat; | |
}; | |
Date.prototype.addDays = function(days) { | |
var dat = new Date(this.valueOf()); // make a new date coz we can't change the original | |
dat.setDate(dat.getDate() + days*1); // force days to be integer instead of string | |
return dat; |
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 parseNumber(str) | |
{ | |
str = (str + '').replace(/[^\d,.-]/g, '') // just digits, separators and sign | |
var sign = str.charAt(0) === '-' ? '-' : '+' // store sign | |
var minor = str.match(/[.,](\d+)$/) // filter decimals | |
str = str.replace(/[.,]\d*$/, '').replace(/\D/g, '') // remove decimals and any integer separator | |
return Number(sign + str + (minor ? '.' + minor[1] : '')) // build number | |
} |
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
-- Coda Light | |
-- | |
-- By Henrik Nyh <http://henrik.nyh.se>, 2007-04-26 | |
-- His original script: http://henrik.nyh.se/2007/04/coda-light-applescript | |
-- | |
-- Changes for Transmit 4 and AppleScript 2 by Ian Soper <http://iansoper.com>, 2010-12-15 | |
-- | |
-- An AppleScript to start working on a web development project by | |
-- * opening the project in TextMate, | |
-- * opening related URLs in the default browser, |