Re-sizing Images in Javascript
Uploading files asynchronously with XMLHttpRequest is a neat trick on its own, but what I really wanted was a nice way to upload images from my phone and/or tablet. The problem with this is that technology is evolving quite rapidly these days and m...
Async File Uploads in HTML5
Uploading files using HTML forms has always felt a bit off for me. You had to set your encoding to `multipart/form-data` and the synchronous nature of form posts always made it a waiting game when uploading larger files. Then came AJAX and the dawn ...
Search And You Shall Find
Every blog should have a search box. Not because it's necessary, but because it's fun to implement. A few weeks ago I ran across a small Javascript library called Lunr.js. It's basically a small text indexer that can rank search results and it's wri...
The Gift of Source Code
I'm not sure if anyone is interested in my source code for this blog, but since I've already posted some bits and pieces of it from time to time, I thought, why not release it all? If your browser has a width of more than 720 pixels, you will see a ...
A Tiny Bug
I've been using (and still am in production) an old JavaScript function called `parseInt` when parsing my DateTimes for comments and posts. For some reason it showed some weird behavior today. I noticed a comment that was written on December 0. I lo...
Client-side JavaScript Initialization
Yesterday I started using the BundleController with my JavaScript files on the client-side. I also deployed my ViewManager so that all my views now uses the bundled and minified JavaScript file produced when I start (or restart) my Node.js server. T...
Architecture in JavaScript - Closures
Today is Tuesday, which for me means I've held another tutorial at work. Today it was less hands-on and more of me just talking and showing examples on the projector using the wonderful jsfiddle JavaScript quick-hack-tool. My talk today was mostly a...
Handling Views in node.js
This weekend, my wife and daughter have been away up north, visiting my in-laws. I thought this would be a great opportunity for me to buffer up on some blog posts, but it seems like my inspiration mostly left with them. Last Tuesday at my weekly tu...
Automatic Minification and Bundling with node.js
Scott Guthrie recently wrote about the new minification and bundling process that has been built for ASP.Net 4.5. I read his blog post, liked what I read and then I though of doing the same thing for my blog. I've been looking at minification progra...
Architecture in JavaScript - Inheritance
There's been a lot of debate over the years about whether JavaScript is an object-oriented language or not. Most of these discussions seem to pan out into arguments over inheritance. JavaScript, by design, lends itself well to inheritance through ex...
Architecture in Javascript - Modules
About a week ago I wrote about turning client side JavaScript into CommonJS modules. The scoping of variables in CommonJS makes this easy, but what if we wanted to do it the other way around? In CommonJS, modules are scoped by file and all public me...
The power of CommonJS
A few days ago when I was putting my posts into CouchDB, instead of relying on a static HTML file, I also implemented templating with Mustache. Mustache is small, easy to use and has almost no advanced features. It's power lies in the vast amount of ...