Javascript Determine Daylight Savings Time

var isDST = function(){ var now = new Date(); var dst_start = new Date(); var dst_end = new Date(); // Set dst start to 2AM 2nd Sunday of March dst_start.setMonth( 2 ); // March dst_start.setDate( 1 ); // 1st dst_start.setHours( 2 ); dst_start.setMinutes( 0 ); dst_start.setSeconds( 0 ); // 2AM // Need to be on […]

Javascript Parse URL Function

var parseURL = function (uri){ var url; if (typeof uri == ‘undefined’) { uri = location.href; } else if (uri[0] == ‘/’){ uri = location.host + uri; } url = uri.match(/^([^:]*:\/\/)?([^:]*:[^@]*@)?([^\/:]*\.[^\/:]*)?(:[^\/]*)?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i); delete url.input; url.protocol = ((url[1])?url[1]:’http://’).split(‘://’)[0]; url.user = (url[2])?url[2].split(‘:’)[0]:undefined; url.password = (url[2])?url[2].split(‘:’)[1].split(‘@’)[0]:undefined; url.host = (url[3])?url[3]:location.host; url.hostname = url.host; url.port = (url[4])?((isNaN(parseInt(url[4].split(‘:’)[1])))?80:parseInt(url[4].split(‘:’)[1])):80; url.path = (url[5])?url[5]:’/’; url.pathname […]

Adobe Air Web Browser

I’ve been playing with Flex and Adobe Air for a while now, and I’ve wanted to test the abilities of the Air HTML component for future projects. So I built my own mini Air Web Browser.