RDBPaste: Pure JavaScript Pastebin

Yes, it’s one of those projects that call for a very skeptical response… You rarely, if ever, write a whole web app using JavaScript alone. Delegating business logic entirely to browsers is still a relatively new concept, and most developers (myself included) rather stick to known methods of running server-side scripts to do the job. Database access is one of the main hurdles in doing this. David over from RDBHost has been offering a solution to this problem for some time now, and he’s been finishing the JavaScript API. Now that the API is stable and documented, he wanted me to give it a test-drive and write an app that would make full use of it.

[ read more... >

Comments

Turn Vim into Powerful JavaScript Editor

After trying NetBeans, AptanaStudio, Emacs, KomodoEdit, and Jedit, I’ve finally settled on Vim (again) for my JavaScript/HTML/CSS editing needs. AptanaStudio is ok by default, but extending it wasn’t very fun. NetBeans simply doesn’t do what I need. KomodoEdit has no code re-indentation (code formatting) feature which is a big fail in my opinion. Jedit was just ugly, and the default feature set left a lot to be desired. There are tons of plugins for it, but I just didn’t have the time to try them all out.

Vim doesn’t have too many features related to editing JavaScript code out of the box. Indentation is horrendous, error-checking is non-existent, and it’s generally a pain in the arse. However, Vim is very extensible, and with a few cool plugins, you can turn it into a powerful JavaScript editor within a few minutes (plus the time you waste reading this post, of course). Here’s a list of plugins that transform Vim into one of the coolest JavaScript editors i’ve used.

[ read more... >

Comments

KISS Templating for jQuery (and JavaScript)

I’m currently developing a very cool site, called Herd Hound. Can’t tell you what it does just yet, but if you like surprises, you can register for the Alpha release (due in less than a month). Most of the development happens in jQuery, as it builds and displays the entire UI of the site (well, not the alpha registration site, but the product itself, right?).

During development, I didn’t want to pull all the HTML from the server, but rather have JavaScript generate the bulk of it, and do it dynamically, too. In other words, I needed a templating language for jQuery that would work similarly to templating languages like Django, Bottle, and others. After looking around, I haven’t found any good solution that works reliably cross-browser (and cried because I knew I should have gone with MooTools which has one). I had to reinvent the wheel and write my own templating language.

[ read more... >

Comments

GAE Quick Tip

Do you need to discover whether you’re on a development server and do something with that information in your code? Well, here’s how to do it:

IS_LOCAL = os.environ['SERVER_SOFTWARE'].startswith('Development')

[ read more... >

Comments

Herd Hound Rewrite and App Rebirth

When i started coding on Herd Hound, working 15 to 17 hours a day on average (including the day job), under a lot of pressure, and very tired all the time (no shit, right?), I’ve started with a very vague notion of what the app would look like. What I knew was that the backend would be a very simple web service providing data in JSON form, with a single URL that would return the actual user interface. The user interface would actually contain tons of business logic, and it would, in essence, be a RIA. That’s how it all started.

[ read more... >

Comments

Vim JavaScript Indentation

JavaScript indentation doesn’t seem to be an easy thing to implement. I don’t know why, but there are so many plugins that get it wrong. I’ve struggled with some of the quirks in such plugins, but I think I’ve finally found the one that works. I won’t bother you with details. Go check out Better JavaScript Indentation. Make sure you’ve removed other similar plugins before you use it.

Comments

onbeforeunload Event Browser Support

Today, I was reading about the onbeforeunload event. I have a custom event system for Herd Hound app, so I wanted to destroy all event handlers before allowing the browser to navigate away from the page. For this I thought I’d use the onbeforeunload event, but then I read it wasn’t widely supported. As most frontend engineers, I have a multitude of browsers installed on my laptop, so I did a bit of testing.

[ read more... >

Comments