function checkExists(myVar) { if (typeof myVar === 'undefined') { return false; } if ( myVar === null ) { return false; } if ( myVar.length == 0) { return false; } return true; }
Tuesday, January 17, 2017
Javascript checkExists
Friday, January 13, 2017
MYSQL Query for Timestamp Age in Hours
SELECT `route_id` FROM `route` where `is_active`=1
AND TIMESTAMPDIFF(HOUR,`dt_update`,CURRENT_TIMESTAMP())< 48;
AND TIMESTAMPDIFF(HOUR,`dt_update`,CURRENT_TIMESTAMP())< 48;
Monday, January 9, 2017
Javascript misterClean string cleaner
function misterClean(x) { x = x.replace(/^\s+|\s+$/gm,''); // remove end whitespace x = x.replace(/(\r\n|\n|\r)/gm,""); // remove line breaks return x; }
Subscribe to:
Posts (Atom)