By jberman on May 22, 2009 at 10:35 am.
Filed under: Actionscript, Languages
I couldn’t find this written anywhere so I wrote it myself.
I was storing dates in this string format: “2009-02-18 14:47:24″
And I needed to convert it to a date in Actionscript. Here is the function:
function parseDate(str:String):Date {
var d:Array = str.split("-");
var year:Number = parseInt(d[0]);
var month:Number = parseInt(d[1]);
var d2:Array = d[2].split(" ");
var day:Number = parseInt(d2[0]);
var d3:Array = d2[1].split(":");
var hour:Number = parseInt(d3[0]);
var minute:Number = parseInt(d3[1]);
var second:Number = parseInt(d3[2]);
var theDate = new Date(year, (month-1), day, hour, minute, second);
return theDate;
}
By jberman on May 21, 2009 at 4:05 pm.
Filed under: Javascript, jQuery
Saw this recently, found it useful, figured I’d share it. I’m still getting comfortable with all that JQuery has to offer and having a quick reference definitely helps. Enjoy!
http://nettuts.s3.amazonaws.com/154_cheatsheet/jquery12_colorcharge.png
By jthomas on May 15, 2009 at 2:51 pm.
Filed under: Quick Tips and Tricks
I always have a moment of hesitation before I put my (or anyone’s) email address somewhere on the public web. While I’m not completely convinced of their prevalence, I understand that there are crawlers looking for email addresses. These bots are said to cultivate these email addresses which are later used for spam and who knows what else.
Wondering if there was something easy I could do to combat this I stumbled across a perfect little solution. Dan Benjamin of Hivelogic fame had already created the exact thing I sought out. It’s called Enkoder, and is available in both OS X app and browser form. Usage is simple, just plug in the email address and link copy and you are given the <script> tag to paste into your HTML.
By rgriffith on May 14, 2009 at 4:03 pm.
Filed under: Browsers, IE, Quick Tips and Tricks
Today, Jordan and I were trying to view a piece of rendered source in IE that was put into a div via Ajax. I Googled “IE View Ajax source” and figured I might find an add-in to IE or something that would accomplish this. The first link I found said all that you needed to view this was paste the following code into the address bar in IE:
javascript:'' + window.document.body.outerHTML+ ''
Or you can use this bookmarklet (Drag to links bar or add to Favorites): View Generated Source.
I know, I didn’t believe it would work either but it does work. The HTML that it outputs though is very, very scary.
The page where I found this is here: http://ericappel.net/blog/2006/10/03/ViewHTMLSourceGeneratedByAJAX.aspx
In addition, apparently Microsoft makes a developer toolbar for IE (7 not 8) that you can download as well. Microsoft Developer Toolbar.