
I’ve been playing with GitHub Hosted Pages, by porting whatisthelatestguardianheadline.com over to pure JavaScript and setting it up to run on GitHub. You can see the end result (maybe, I’ve only tested it on Chrome) over here…
http://revdancatt.github.com/whatisthelatestguardianheadline/
…and the GitHub page for it is here…
https://github.com/revdancatt/whatisthelatestguardianheadline
…should you want to pick apart my code, or even better make it work on things that aren’t Chrome.
The GitHub Hosted Pages Part
I didn’t realise until just the other day that you could actually host pages on GitHub. I’d seen it done a couple of time but never really paid attention until Michael Brunton-Spall posted his HTML5 + JavaScript slides fork.
I often (well often-ish) throw together quick JavaScript only hacks to play around and end up throwing them up onto a Google AppEngine instance for no particularly good reason other than habit, which of course burns up an instance quota (for various tedious reason I don’t currently self host).
Now, by making a magic branch called gh-pages hosting on GitHub is easy. Setup an index.html file, stick it into your gh-pages branch and (after a short while) there it is being hosted. Here’s the GitHub page for it with the normal folders and files for a minimal webpage.

The nice thing is that I was planning to put more of my javascript (and processingjs) experiments on GitHub anyway, now I get the hosting with it too (or the other way round, by hosting on GitHub I have versioning thrown in). Having version control and hosting that tightly coupled makes me very happy for some reason.
The Cloud9IDE coding part
Now, right off the bat, I’m not really an IDE kinda guy, I like my colour syntax highlighting but I’m not that bothered about all the magic autocompletion stuff, a simple (colourful) text editor is pretty much all I need. With that in mind I gave Cloud9IDE a spin.
It’s just what you’d expect, a text editor in a browser with all the files held on the server rather than your local machine. The magic part comes when you connect it to GitHub, any of your project can be cloned into Cloud9 and then edited, here’s my project in cloud9…

By connecting the IDE to GitHub I can pull over any project I like, work on it, and then push it back over when I’m ready. There’s a Preview option which launches the current page in a browser and because I’m dealing with just JavaScript this is fine.
Creating a new project is easy, go over to GitHub, make a new repository, pull it into the Cloud9IDE and start bashing away. Not a single file hits the local machine, all the files are *handy wavy* over there.
Obviously this pretty much only works for anything that only needs JavaScript and doesn’t need API keys you want to keep hidden, but that’s good enough for me*
I like the idea that I can sit down at any machine with a modern browser, login and start working on my files. Again the tight integration with GitHub and Gloud9′s own collaboration tools make it feel like a good way of working. It makes me feel more like I wish all the project I’m working on could work this way.
Problems and general feelings of woolliness
I have 3 general problems with this setup.
#1
The GitHub integration once you’ve done the initial clone is all (browser based) command line stuff. So I’m still typing ‘git commit -am "some message"‘ and switching branches by hand. I’m used to using GitBox and Kaleidoscope for all my Git and Diff needs, because I like a bit of luxury now and then.
It’d be great if this was more UI based rather than jumping down to type wordy stuff in.
#2
Image upload, or any binary file uploading. You can do it via commands from the annoying virtual command line but it’s a big faff. I ended up (for a different project) pulling the project down to my local machine, adding the images and pushing it back up. Which kind of defeats the whole it’s-all-in-the-cloudness about it.
Both points above are on the Cloud9IDE roadmap so I’m not that worried about it.
#3
What I am worried about though is the whole losing edits and changes bit. Locally the files I’m working on sit within my Dropbox folder. So every time I hit save, which I do often, up they go to Dropbox where they are safe, or at least safer than just on my machine.
If my machine were to die, I could just pop over to another one of mine and pickup from where I left off. In the worst case I’d need to install Dropbox on a new machine and grab the files.
With Cloud9IDE I’m only as safe as my last push command, if I spent the afternoon working, previewing and committing, but not pushing and cloud9IDE went away, I’m only as good as my last version on GitHub.
I’m not yet sure quite how I feel about that.
*Well you can do NodeJS stuff and stick things in a private account, but where’s the fun in that?