Creating a faster forEach shim 15 February, 2014

shimUnfortunately we still need to support IE8 at our company, as that is what customers demand. Frustrating but necessary. So we have to spend a great deal of time fixing performance issues in this old browser. Recently a lot of us had serious performance problems with looping over arrays with the ES5 Array#forEach, so we had to change the code to “regular” for loops. And in one case even create an asynchronous forEach because IE8 just can’t handle the amount of data we are throwing at it.

(more…)

Fixing console.log() 9 February, 2014

I’ve written about the problems of console.log(). I’ve also said that I’m going to do something about it once I have some spare time. Well, I had some spare time, so I fixed it.

(more…)

console.log() is not a log 13 November, 2013

Today I’ve stared in my screen in disbelief when I’ve found out that `console.log()`, in Chrome (haven’t tested other browsers), doesn’t work the way I thought it works. I’d rather not think back on how many hours I’ve wasted by missing a bug because of this. So what’s the big deal? Well, it turns out that when you log an object  to the console, it might not actually log what you think it should log.

(more…)

Notifications overload 10 November, 2013

This is one of those first world problems, for sure, but it’s also a good startup/pet project idea. I’m sure anyone with a smartphone has the same problem, they might just not realise they have it. Notifications. They’re great, they let you know what’s going on. But it’s a problem because you get notified two, or more, times for everything.

(more…)

On semicolons & brackets in JS 25 October, 2013

SemicolonJavaScript allows you to omit semicolons at the end of certain statements as they will be inserted for you automatically. One can also put opening curly brackets on a new line. These two things are optional. Until they aren’t. And then it hurts.

(more…)

30 days of GitHub 2 October, 2013

30githubToday marks my 30 day streak on GitHub. I didn’t start off with the goal of reaching 30 days, it just kinda happened. Sure after a while I didn’t want to break the streak, so I’ve “cheated” a bit occasionally with just opening a issue or by removing a space here and a new line there. But most of the days I’ve actually done something meaningful. And I plan to continue.

(more…)

grunt-stitch-js 21 September, 2013

stitchingI’ve been working on a small JS library lately and as things started getting bigger and bigger it was time to split the code across multiple files. Having small pieces of functionality in separate files is great for reusability and testability. But then I had a problem of how to create the output file that would contain all the code, wrapped in a IIFE.

(more…)

No more comments 12 September, 2013

no more spamI’ve decided to disable new comments on this blog. To be honest I just got feed up with all the SPAM that was coming through the Akismet filters and I haven’t seen a legitimate comment in months (which is a bit sad, but entirely my fault since I haven’t been writing all that much lately).

(more…)

ExterminateGlobals.JS 9 September, 2013

ExterminateGlobals.JSUnwanted globals can sneak into your JS codebase quite quickly, all you need to do is forget that pesky `var`. That can off course introduce all sorts of trouble to your code base. If you’re lucky you’ll just be a bit embarrassed when your co-worker finds the global. But if you’re unlucky, that global can cause all sorts of bugs through your code base.

(more…)

Working alone is bad for me 17 August, 2013

Teamwork I haven’t written in a while here, I know, I’ll try to amend this in the future. But the reason for my lack of writing is quite simple: I switched jobs and moved to another country. So you can imagine I’ve been quite busy and simply hadn’t had the time (+ I had to wait for more than 3 months to get broadband at my new place, but that’s a different story).

(more…)