Tuesday, December 13, 2011

Giving back

My code was accepted and merged to the main Code Mirror repo!  I should get myself one of these:
I can now claim to be an open source contributor.  I ended up generalizing my ejs mode to an Html Embedded mode so I was able to easily make a mode for JSP and ASP.Net as well.

Sunday, December 11, 2011


So normally I hate diversions, but this one proved fruitful.  I got a bit obsessed with the lack of ejs support in nide.  Looking into the code, I realized the editors were integrated from another project: CodeMirror (git repo here).  So I forked CodeMirror and started digging in.

The amount of code I added is pretty minimal, but it was trickier than I anticipated.  I think I finally got it right though: https://github.com/whalefood/CodeMirror2
I'm still debating whether to send a pull request to the main branch.  I'm not sure how popular ejs is and even the mode for mustache didn't make it to the main line.  It would be cool to have my code integrated though.  I guess no harm in asking.  Next step: stick it in Nide.  

Sunday, December 4, 2011

Starting real development

Finally, it's time to start coding.  I found a cool web based ide for node, made with node, called nide that seems to work pretty well.  It's just missing formatting for ejs.  Maybe I'll try to add ejs support myself...

I've also been learning more about how to properly set up an express project.  Trying to find some good examples, I actually ran into some hidden examples in the source of the express project.  I found this one especially useful:

Express and agent-forwarding

The two subjects in my title are completely unrelated, but I'm lazy and didn't want to write two smaller posts. 
After doing some more research, I've decided to go with Express for my framework.  It's another mvc framework more geared towards node than backbone.js is, with cool things like pre-built session support and multiple view engine choices.  For my view engine I'm going with ejs.  Jade seemed interesting, but I prefer working closer to the raw html. 
So I've installed node and express locally and got it running on my mac.  I committed and pushed to git, and then I needed to deploy to my EC2 server.  So I ssh to the server and do a "git clone" and bam: Permission denied (publickey).  Turns out I needed to enable agent-forwarding (thanks to this blog post).  Philipp has a good description there, but basically I just needed to uncomment a couple lines from /etc/ssh_config on my mac.