Show Me Your Email!
If you sign up for a social networking account, you can understand that the terms of service contain stuff like “you give us permission to publicly display your information for the purpose of providing you the service”. How would you feel if your email provider had the same in their TOS?
New Node.js Book from Packt
Node.js is the new cool thing on the web, and everybody seems to be talking about it these days. And when everyone starts talking about something you start seeing books on the subject. Some time ago, I’ve caught David’s anouncement of the book he was writing, and was wondering about when it will be available, when Packt contacted me asking for a review of David’s Node web development, which has just been released (August 2011).
Bullet-proofing Setters and Getters
JavaScript has two very handy methods that you can use on an object:
__defineSetter__(), and __defineGetter__(). They allow you to write
accessor functions for your objects. Here, I’ll show you how to write them so
they are as tamper-free as possible.
Classic Web Form POST in AJAX apps
So, you have an AJAX app that has to do a normal POST (not an AJAX post) using a regular web forms for whatever reason? While the solution outline here is not complete (it does not cover doing cross-domain requests), here’s a simple pattern I used to make Ashigaru jQuery plugin work with the Samurai payment gateway.
The Best Git UI for Vim: Fugitive
Tim Pope, known to many Vim (and Rails) users as just tpope, very well known for his many vim- projects (including the infamous pathogen plugin), has this to say about his Fugitive plugin for Vim:
I’m not going to lie to you; fugitive.vim may very well be the best Git wrapper of all time. Check out these features: […]
And he didn’t lie. Fugitive is so awesome it may well be the reason for you to switch to Vim right fucking now. But of course, you are already using Vim, aren’t you? Oh and if you’re not using Git, you absolutely suck. :P
Passing by Value vs Passing by Reference in JavaScript
A thing that I’ve heard desktop application developers say about web developers is that web developers don’t know what phrases passing by value and passing by reference mean. I’m sure most of us, web developers, know what those mean. If you don’t, you should learn them ASAP!
To recap, passing by value means that the value that you pass to a function gets cloned and independent, and that changes to that value made within the function are not reflected on the original value. On the other hand, passing by reference means that the object passed to a function is linked to the one that is passed, so the original is affected by any changes that happen in the function.
I’ve done some testing to see when the values are passed by value, and when they are passed by reference in JavaScript, and here’s what I’ve found out.
Profilejs: V8 profiling for Express framework
I’ve started using Danny Coates’ node-inspector recently. It works very well as a graphical debugger (runs in a webkit browser), and it can also serve as a profiler in conjunction with v8-profiler.
I wanted a tool that would profile all requests for me, so I could browse and pick through the logs afterwards, but I couldn’t find one. So I decided to write a middleware for Express that would pipe all requests throug the v8-profiler. The result is Profilejs.





