Raymond Camden's Blog Rss

New ColdFusion Builder Extension: GistCreator

3

Posted in Development, ColdFusion | Posted on 05-29-2012 | 625 views

A few months back I switched to using Gists (https://gist.github.com/) for my code samples. For the most part it just worked fine. I did have to do a bit of work to get it right under jQuery Mobile, but outside of that I'm happy with the change.

Now that I've made the switch, I find myself making a heck of a lot of gists. I tweeted earlier today that it would be cool if my editor would make it easier to create them. Right now I spend my time using Sublime Text 2, ColdFusion Builder, and, um, another editor. @bittersweetryan pointed out an excellent plugin for Sublime. That worked great. But I thought it would be fun to build an extension for CFBuilder as well. So I did it. Because I do that now. I love my job. A lot.

GistCreator works with both files and in the editor. To create a Gist out of a file, just right click:

Or - you can select text in the editor and create a Gist out of it:

You can also just right click in a file, and if nothing is selected, the entire file is sent.

Once done - the extension returns the URL:

And that's it. Right now the extension only creates public gists and doesn't allow you to name it, but it should work fine for now. Also, it is a bit brittle. If your authentication changes then the extension will not handle it well. As always, I'm welcome to folks checking it out and adding features.

Fork it here: https://github.com/cfjedimaster/GistCreator

Building an HTML5 Comic Book Reader

Posted in jQuery, JavaScript, HTML5 | Posted on 05-29-2012 | 861 views

Following up on my Sunday blog post on comics, I thought it would be fun to share a little experiment I built this weekend. Comic books are available in a compressed format typically called CBRs or CBZs. These aren't a special format, just simple compressed archives. CBRs are RAR files and CBZs are zips. While there doesn't appear to be good support for RAR files (I've only found a Java library to list the contents), the Zip format is much more widely used and easy to work with. In fact, you can find an excellent JavaScript implementation: zip.js I thought it might be fun to try using that to build my own web-based CBZ reader. Here's how I did it.

Sunday Review: Comics I Read

13

Posted in Books | Posted on 05-27-2012 | 1,058 views

As a teenager, I was a regular, if somewhat casual comic reader. I picked up some X-Men, Spiderman, and, of course, Star Wars. However - I can still remember the day when I ran across this gem at my local store:

I had no idea comics could have such incredible artwork. Of course, I didn't even know what to expect when I actually read it.

I read comics even more then, and throughout college, but afterwards, I slowly stopped picking them up. Once Sandman ended, I felt like there wasn't much out there for me. (Obviously there was great stuff going on, I just didn't know.) Plus, I got tired of the whole "trying to get the complete story" thing by buying what felt like 30 different X-Men titles.

A few years back though I found myself drawn back. I'll be honest and admit it was due to finding out you could download comics online. I didn't even know digital versions of comics existed, but it was enough to bring me back to my local comic store and start a monthly selection of comics.

So - here is what I'm reading. They are in no particular order and are presented for you to comment, ridicule, and suggest.

One of my first discoveries was the new line of GI Joe comics. These include: GI Joe, GI Joe: Cobra, and GI Joe: Snake Eyes. Each of these comics share the same world (there is also a GI Joe: Real American Hero) and a much grittier, realistic version of warfare. (If you have a somewhat loose version of realism.) You won't see soldiers firing blue and red lasers. People, lots of people, actually die. The story is pretty damn incredible. In this version, Cobra was, until recently, an unknown entity. The story of how Cobra moves on to the world stage is pretty damn cool. I read GI Joe as a kid, and yeah, I still pick up the somewhat childish RAH one as well, but I definitely recommend this line. If you only select one though, get Cobra. As we know, the bad guys always have the best story.

Forget the horrible remake. Heck, forget the really good recent movie. This comic is a fascinating look at the Planet of the Ape's world and mythology. It has many threads tying it to the original movies but has a very unique take on the idea as a whole. Great artwork as well.

I just started reading Fantastic Four. I wanted to read one "mainstream" comic, and while I probably would have preferred an X-Men title or even Avengers, I thought I'd give FF a try. I never read them growing up, but something called me to it. I'm still not quite sure it's worth the money, but any comic that features Galactus every now and then has to be good. The issue I read yesterday was pretty damn incredible, so I'm going to keep it for a while.

If I had to recommend only one comic it would be "Locke and Key" by Joe Hill (who is also a damn good prose author as well). A very dark fantasy/horror series, it just wrapped up its fifth set and is wrapping up with a final story line. (I know some folks don't want to take a chance on a comic that never ends.) I'd also recommend "The Cape".

For my final recommendation, try picking up "Sweets". This book was written by a local creator, Kody Chamberlain. I've known Kody for some time now and his work is pretty damn stellar. I made him promise me to draw me into his next series in exchange for some software I wasn't using anymore. All I hope is that I don't end up as a murder victim.


Taking ColdFusion Closures all the way to 11

3

Posted in ColdFusion | Posted on 05-25-2012 | 1,541 views

I have to admit - closures in ColdFusion 10 were not terribly exciting to me. Don't get me wrong - I'm really happy they were added. Much like I was happy the engineers added implicit notation and other "syntax sugar". But it's not really a "feature" per se. It's there - I'm happy it's there - and my brain will just mentally keep it in mind as I write ColdFusion.

That was how I felt before cfObjective. Then I attended Mark Mandel's session on Closures and he opened my eyes to the possibilities. Specifically, he demonstrated his Sesame library - a set of closure-based utilities you can include in your projects. Simple, but nice things like...

and

or

Nothing too revolutionary (and parts of Sesame are based on things found in Groovy), but seeing them in action really made me appreciate the support of closures a lot more.

Things get real interesting though when you look at the concurrency aspect. ColdFusion added threads a while back. They are a powerful, if somewhat dangerous, addition to the language. Running code in a thread and ensuring you properly handle the end result can be tricky. Until you try Mark's code:

In case it isn't obvious - the _eachParallel function runs once for each item in the array and fires the code concurrently. My closure runs a sleep function which will slow down the processing of the page. But since the closures run concurrently, you will only have to wait for the slowest one (5 seconds) and everything else will be complete. Here's a screen shot of the output from that sample:

Pretty cool!

Example of getUserMedia and CSS Filters

2

Posted in Development, jQuery, JavaScript, HTML5 | Posted on 05-25-2012 | 2,011 views

One of the more interesting features on the bleeding edge of HTML5 is getUserMedia. This API covers basic access to the user's audio and video devices. I first blogged about this a few weeks ago with my face detection example. Since that time I've been curious what other uses would be possible with this support. As I said in the previous blog entry, chat and quick picture taking is kind of obvious. I'm more interested in the not so obvious (and possibly not very practical ;) examples.

Best of ColdFusion 10: HTML Email Utility

8

Posted in ColdFusion | Posted on 05-24-2012 | 1,959 views

Welcome to the first installment of my reviews of entries in the Best of ColdFusion 10 contest. If you attended cfObjective last week, then you know this ended up as a good news/bad news type situation. The number of entries were relatively low - 4. The quality of the entries though were high. Personally - I do these contests because I love to see what people build. It's fun. So no matter how many people find the time to participate, I consider it a net win for all of us. With that out of the way, let's look at our first entry, the HTML Email Utility by some dude named Ben Nadel.

Context Menu Example with jQuery Mobile

7

Posted in Mobile, Development, jQuery, JavaScript, HTML5 | Posted on 05-23-2012 | 2,071 views

Yesterday a reader asked me about building context menu support for images within a jQuery Mobile operation. Turns out it's pretty easy. Obviously there is no such thing as a right-click menu on a touch device. That being said - the convention that most mobile applications use is a "taphold" listener. You touch the item with your finger and wait. In a second or two, the context menu pops up. The taphold event is trivial to use in jQuery Mobile (with a caveat I'll get to in a second), but what isn't as trivial is deciding what UI to use. jQuery Mobile will - soon - have a popup UI item. For now though I decided on the excellent SimpleDialog2 plugin by JTSage. Let's look at an example.

ColdFusion Developer Week (and graphics)

Posted in ColdFusion | Posted on 05-23-2012 | 1,234 views

As announced on the Adobe ColdFusion blog, ColdFusion Developer Week is back. This is an entire week of online ColdFusion presentations from experts in our community. The best part? It's entirely free! Sign up via the link above.

Also - I've attached a zip to this blog entry with official logo graphics for ColdFusion and ColdFusion Builder.

EDIT: Joe Brislin kindly gave me both a Windows and Mac icon file you can use for your CFBuilder or other needs. The zip includes his zip bundled in. Thanks Joe!

Notes on the ColdFusion 10 EULA

Posted in ColdFusion | Posted on 05-22-2012 | 1,287 views

I've had many folks ping me about the ColdFusion 10 EULA. This morning, product manager Rakshith posted a blog entry on it:

ColdFusion 10 EULA

Creating watermarked images in PhoneGap

4

Posted in Mobile, jQuery, JavaScript, HTML5 | Posted on 05-22-2012 | 1,215 views

A reader asked me if it was possible to watermark images (like those taken with a camera) in PhoneGap. This is rather trivial using Canvas (hey, it does have a use!) so I whipped up the following example to demonstrate it in action.