I AM FOO

Pimp that command line interface

Posted on

I use my CLI for pretty much everything that isn't surfing and coding nowadays. It's what ties my whole work flow together and I need it to be user friendly, visually pleasing and as fast as possible. This will be a simple walkthrough on how to install the awesome zsh shell and prezto. Zsh Zsh is a powerful UNIX shell that can be used as an interactive shell and as a scripting language interpreter. One of the high points about zsh is that everything you've learned when using bash still applies.…

Command line utilities with Node.js

Posted on

I try to make my life as easy and productive as possible. Whenever I notice that a simple and pretty mundane task takes more time that I think it should - I simplify it. The solution for me is normally to write a command line utility that does the task for me. One would normally, on a UNIX system, write it with Shell Script but for me personally I'm much more comfortable with Node.js and CoffeeScript. This is an example on how I go about writing such an utility. Dependencies and placement First…

Automatically binding jQuery events

Posted on

I would like to share a little “snippet” on how to automatically bind jQuery events in a DRY way and which also looks good syntax wise, according to my own taste. You can easily modify it if you need more functionality or want a different structure. What I wanted was being able to write a class the following way: class Example extends Core beforeFocus: -> # Do something before focus. onFocus: -> # Do something on focus. afterFocus: -> # Do something after focus. As…

Profiling Paint Times with Chrome DevTools

Posted on

A couple of days ago a colleague of mine noticed that this site was quite sluggish during scroll on IE and Windows Phone. At first we thought this was due to a JavaScript event on scroll or mousewheel but the issue was clearly visible when disabling all JavaScript on the site. This was clearly an CSS related issue and after further debugging we noticed, surprisingly, that the whole page was repainted when scrolling. This post will guide you through how to debug paint bottlenecks and how I solved…

CoffeeScript jQuery plugin boilerplate

Posted on

There are plenty of jQuery plugin boilerplates and I use a couple of different ones depending on what I need. A while back I got really tired of shimming jQuery plugins, when using RequireJS or Browserify, so I decided that atleast my plugins would be AMD and CommonJS compatible. This led to the creation of my own boilerplate that I thought I would share for the lazies out there. The boilerplate This boilerplate, which is heavily inspired by jquery-boilerplate and umd, is pretty simple and a goo…