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…)

Callback parameter should always be last 10 February, 2013

callbacksNode.js is famous for being asynchronous. That means you’ll have a lot of callbacks or anonymous functions in your code. This can quickly lead to somewhat hard to follow code (hello callback pyramids). But that’s not what I want to talk about today.

(more…)

hnHiringFilter – filter jobs on Hacker News 1 February, 2013

hnHiringFilterI’m currently looking for a full time web-dev  job in London. And a few days ago I remembered the monthly “Ask HN: Who is hiring?” threads on Hacker News. I also remembered what a pain it is to browse that thread. Especially if you’re not from the Bay area, for where most of the jobs are.

(more…)

Load JavaScript and CSS with one request 23 January, 2013

pagespeedWhen it comes to web pages I’m a bit of a speed freak. I’m constantly on the lookout for new techniques to make my pages faster. So it’s a great pleasure that I can now say that I came up with a new* technique to speed up page rendering.

The idea came to me while I was analysing one of my pages and trying to figure out how to reduce the number of requests. I asked myself: “would it be possible to, somehow, combine CSS and JavaScript into one file?”. And the answer, it turns out, is yes!
(more…)

Client side validation on mobile 14 January, 2013

validationWe all know that client side form validation leads to a better user experience, but why are so many pages out there without it?

JavaScript validation can save your users a lot of time and frustration by informing them that they did something wrong as early as possible. And this is especially important on mobile. Everything takes at least twice as long (and I’m being generous here) on mobile than on desktop. Be it request time, render time or, most importantly, input type.

(more…)

Nobody cares you use Bootstrap 10 January, 2013

Twitter BootstrapReading Hacker News threads, related to Twitter Bootstrap, is lately kinda like going on a walk with a child, that just learned the word “car” and is now pointing and shouting “car, car, car!” all the time. Yes, it’s a car now, please, shut up.

(more…)

SDSzombi – a weekend hack 30 December, 2012

sdszombi.comLast weekend I came up with an idea for a mini web page: SDSzombi.com. The idea came to me after the friday protests in our capital city. I won’t explain the issues in Slovenia at the moment, but suffice to know that our government (or rather the leading party) has labeled all protesters as zombies. They’ve done that on Twitter, where they also regularly block anyone who expresses disagreement with them. So the idea was born: create a page where users can check if the ruling political party has blocked them. There’s just a counter of the number of blocked users and a simple list of blocked users. That’s it.
(more…)