You may have seen be tweeting about Runnable.com this week. I've spent a decent amount of time figuring out how their platform works and getting CFML (Railo) running on it. Basically, Runnable.com is CFLive.net, trycf.com, and JSFiddle.net all mashed up and super cool. In short, the platform lets developers post any code samples they want for any database/language/framework up on the Internet so other developers can come along and not only read their code, but run it right there in the browser. It doesn't stop there, other developers and fiddle with the original code and run the new version right there on the site to figure out how it works.
It's all possible with Docker.io, a cool virtualization platform I just learned about, and Runnable has the whole thing running on top of Amazons EC2. Basically, each code sample is an entire Linux VM with whatever installed on it that the publisher wanted to set up. The template of this VM is stored and every time a visitor comes to the site and wants to check out that code sample, a dedicated VM is spun up in seconds just for that user. Docker.io allows them to simultaneously service hundreds of users because it shares overlapping resources between the VMs so they're very lightweight and come online in seconds.
And since each user gets their own isolated playground, there's no sandbox security to worry about. In fact, each code page has an emulated bash shell with root privileges at the bottom of the page! Any local changes made by the visitors of the site, are discarded after they close their browser and the session times out. The code samples aren't limited to a single file of code-- publishers can create tutorials to demo entire frameworks, with multiple files. Need a database? Install one. Need Tomcat? Install it.
So, speaking of Tomcat-- this is where ColdFusion comes in. Runnable's Twitter account popped into a recent conversation and urged us to get CFML setup, so i took the task and ran with it. Due to some issue with the Railo installer which they're looking at, I installed Tomcat 7 with apt-get and deployed Railo 4.1 as a WAR file in the root context. The Runnable guys were super helpful. They exchanged several E-mails with me and even chatted on Skype for an hour last week answering questions, tweaking my setup, and writing down suggestions.
I published a proof-of-concept Runnable called CFML Templating With Tags and then a more involved followup called Use WireBox To Create Objects In ColdBox. I've also created a new GitHub organization called cf-runnable to store all my tutorials. Feel free to send me pull requests, or ask to collaborate and store your CFML runnables there as well. Now, what's really, REALLY cool about Runnable is anyone can clone one of my tutorials, make it their own, and re-publish it under their name. That means no one else has to reinvent the wheel to start putting cool code up on Runnable-- I've already figured a lot of it out and you can springboard off of what I've done, or dive in fresh yourself.
So this is the intro to a blog series I'm going to do how how I got Runnable working with CFML, what little speedbumps I've hit, and how I've been integrating with GitHub to version and host my code. I have a lot of ideas for Runnable- both improvements for them (like beefier descriptions, and embeddable runnables) and ColdBox-themed tutorials I want to create to let people play around with simple examples and how-to's. Stay tuned!