Posts

Showing posts from April, 2015

Timezones whoops in Iphone and Safari with Daylight Savings

Looping through October dates in 2015 for Sydney Australia, I was finding it weird that I had 32 days ! I'm fairly sure that wasn't how the rhyme went. Anyway, looking into it, turned out that when starting at 1/10/2015 and adding 1 day til the end of the month, you ended up with 1,2,3,3,4 - see an extra day there which seems like Sat showed up twice. Turns out, there appears to be a big in the "Spring Forward" part of the Javascript engin there where Midnight on 4/10/2015 is interpreted as actually being 3/10/2015 at 23:00, go figure. In reverse, 5/4/2015 ("Fall Back") was displayed as 5/4/2015 at 1AM!!!! See the quirks below which appears in Chrome; try on an iPhone to see for yourself. Of course it was already asked over there on at stackoverflow. Date TimeZone Offset Month Day Of Month Time UTC Hours Sun Apr 05 2015 00:00:00 GMT+1100 (AUS Eastern Daylight Time) -660 3 5 1428152400000 13 Sun Apr 05 2015 01:00:00 GMT+1100 (AUS Eastern Dayli...

Preparing your CMS/ Web Application to move to SSL

HTTP to HTTPS While change and references in programs to relevant scripts is always straightforward (an odd variable here and there will fix a full site); making the change from non-SSL (http) to a fully SSL (https) website can prove time consuming if you don't want every link on the page to go click-click (redirect to SSL version). Of course the click-click makes sure everyone gets to the write URL with some rewrite rules, it doesn't actually solve the problem of the incorrect content in the first place (contained in the CMS). So, simple solution is to use a scheme-less URI (some poeple call this a protocol relative URL) What is this? All href links, includes, img src attributes etc should exclude the protocol http; instead just using //yourdomain.com instead of http://yourdomain.com This is important as you may initially not have your https site enabled (duplicate content), but you can prepare or change all the href / img src etc links in your CMS and you'll be right...

Checking Email and DNS MX records in ColdFusion with Java DnsContextFactory and Google Public DNS

Nice short function using Google's DNS and Java DnsContextFactory. Based on a script I saw here Note; a trailing space fails here; so make sure that doesn't waste some time of your day when validating. <cffunction name="validateEmailAndMXRecord" returntype="Struct">      <cfargument name="emailAddress" required="true">     <cfargument name="checkMXRecord" required="false" default="true">     <cfscript>     var env = CreateObject("java", "java.util.Hashtable");     var dirContext = CreateObject("java", "javax.naming.directory.InitialDirContext");     var type = ArrayNew(1);     var attributes = "";     var atribEnum = "";     var stReturn = StructNew();     </cfscript>     <cfif isvalid("email", arguments.emailAddress)><!--- basic validation (possibly not good...