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.
Iframe ad killer
Most ads I’ve seen are inside an iframe. That makes them very easy to target and murder with a bit of JavaScript. Here’s a small bookmarklet that will do just that:
Drag that bookmarklet (link) to your bookmarks toolbar, and click it whenever you see too many flash or image banners on the page.
Mind you, this also kills legitimate iframes, so it’s not 100% clean. It will also miss any ads that are not inside iframes.
This bookmarklet is provided to you on works-for-me basis, no guarantees, and no warranties. ;)
The Cost of User Input Sanitizing
You might have heard of ‘user input validation’. That’s all cool and dandy, but have you heard of ‘user input sanitizing’? It is a concept as important as validation. The former checks for validity of the user input, and the latter prepares the user input for further processing by the software.
Now, you might think that proper validation might mostly eliminate the need for sanitizing. But that’s the wrong mindset. In the age of UX, software is expected to fit human needs, and not other way around, so sanitizing input becomes even more important than just validating it. It’s not only done for security reasons, but also to make users’ lives easier, too.
Here I’ll illustrate on a real-life example, why this is so important, and why it costs a lot if you do not care.
Blocking vs Non-blocking: Node vs Bottle
Node.js boasts real-time performance. Of course, depending on hardware, it may show some level od delay in responses, but it is usually able to handle requests as soon as they come in. I have built two simple hello world apps, one running on top of Node.js, and one running on top of Bottle/Bjoern. Bjoern is a non-blocking WSGI server written in C, and it should perform very well on its own, but Python is blocking, so we want to see how it stacks up against a pureluy non-blocking app written on Node.js.
Serial Expresso Testing with Mongo Fixtures
Expresso is a test runner for Node.js. It boasts “high speed parallel testing”. It means it can run your whole test suite of a couple of thousands of tests in less than a second… but this post is not about that. This post is about taking it slow, and running tests one by one like you might be used to from other environments (Python, anyone?).
Mouse and Vim for the Lazy
Have you ever noticed that, when you have line numbers enabled in Vim, you can’t select just the code? You know, the numbers get selected as well. I was too lazy to fix that problem for a while now, and today I took a stab at it finally. Solution was deceivingly simple.
MicroJournal: Personal Desktop Microjournaling
I’ve never been a Twitter addict, mostly because my short notes were public there. But I do need to write shit down as it happens. So I decided to write my own microjournaling app as part of my quest to learn more about Bash scripting.




