Browser search engine shortcuts

As a developer, I spend a lot of time looking up reference documentation while programming. But I found that Googling for it was an unnecessary hassle, especially when I knew exactly what I was looking for and where to find it.

Legacy flexbox invisible float bug

Webkit's implementation of legacy Flexbox has an strange bug that makes flex items become invisible when they're floated. What makes it strange is that the flex items will still take up space in the DOM, as if they have visibility: hidden applied.

IE flex collapse bug

While using Flexbox in production for the first time I discovered a bug that causes flex items to collapse to nothing in IE 10-11. The bug happens when using the flex shorthand property on flex items inside a vertical Flexbox layout.

Ubuntu shutdown hang

Ever since upgrading to Ubuntu 13.04, I've been having a problem where my computer would hang on shutdown (after the OS had shutdown and the partitions had been unmounted).

Make Sublime Text 2 treat script tag templates as HTML

Using templates to render HTML in Javascript is great; but unfortunately Sublime Text 2 treats templates embedded in script tags as Javascript (which means syntax highlighting and completions don't work correctly). Luckily, this can easily be fixed by tweaking Sublime's HTML language file.

Go to Sublime's Packages directory (or the use the Preferences -> Browse Packages… menu item).

Open the HTML/HTML.tmLanguage file.

Change line 286 from:

Auto indent on paste in Sublime Text 2

One thing that I find annoying when developing in Sublime Text 2 is that when you copy and paste code, Sublime doesn't auto indent it to match the current indentation level. However it turns out that Sublime does in fact have this functionality built-in under 'Paste and Indent' (ctrl+shift+v), but this isn't good enough for me because I have custom mouse button bindings for copy and paste (more on that in a future post). Then I realised that I could just swap the keybindings for 'Paste' and 'Paste and Indent' using Sublime's 'Key Bindings – User' preference file.

Sync Sublime Text 2 settings

These days I find myself developing from multiple computers / operating systems (Linux at home vs Mac at work) and I found it frustrating having to manually keep my Sublime Text 2 settings and packages in sync on every computer that I use. However I recently discovered that it's actually quite easy to sync the Sublime Text 2 setting files between computers using Dropbox and some symbolic links. This works because the Sublime Text 2 setting files are the same across all operating systems. Below is how I set this up.

Controlling line breaks

If you've ever used <br>'s to force blocks of text to wrap 'perfectly', you'll probably know that this screws up in fluid layouts:

If you apply display: none to a <br>, does it remove the line break?

GitHub Wiki sidebars

GitHub Wiki doesn't expose it in the UI, but it's actually possible to create a simple sidebar that can be displayed across multiple pages in a wiki.

MIME types demystified

Most programmers know what a MIME type (or Media Type) is. It's the two-part identifier used by programs to determine the format of a file or data. In web development, MIME types are most commonly seen in HTTP requests as the value of the Content-Type header. But what do the two different parts mean and what are their valid values?

Architect, a Javascript template editor

Architect is a web app for editing Javascript templates in various engines. It started life as a simple page for testing Mustache templates. But when I started to get annoyed with the limitations of writing code in <textarea>'s and replaced them with Ace editors, it quickly grew into a fully featured web app with support for multiple templating engines.

VMWare to VirtualBox

Recently I had to run a VMWare VM in VirtualBox (because open source rocks ;)). Turns out you don't even need to convert the VM to the VirtualBox format because VirtualBox can directly run VMWare VM's. All you need to do is create a new VM in VirtualBox, choose the Use existing hard disk option on the Virtual Hard Disk step and select the .vmdk file from the VMWare VM's files. You should also try to match the VirtualBox VM's settings as closely as possible to those of the VMWare VM.

Conditions for text-overflow to be applied

I've been experimenting with the CSS3 text-overflow property a bit lately, and I've discovered that trying to figure out the conditions in which it's applied can be a bit frustrating, since they're not very well documented. In this post I'll outline the conditions that are required for text-overflow to be applied to text.

Adding IPv6 support to your server

With the exhaustion of IPv4 addresses coming closer to reality, I decided it was about time that I added IPv6 support to my server. This turned out to be quite an easy process (at least it was on Linode + Ubuntu 10.04). In this post I'll show you how to add IPv6 support to your own server in 4 easy steps.

Understanding Git

When I started using Git, I came from using Subversion which is on the other end for the VCS spectrum (centralised vs distributed). It took me a while to properly understand Git due to how different it's from Subversion. However, I found an easy way to understand how Git worked was to look at it from the perspective of how objects and references (or pointers) work in your favourite programming language.

Addon SDK double keyboard events bug

Recently, while I was adding keyboard navigation support to an addon, I discovered a very frustrating bug in Mozilla's Addon SDK. Basically, keyboards events (keyup, keydown, etc) were being fired twice on various elements inside a panel. Strangely, this seems to be a Linux specific bug (can't vouch for Mac though) because it isn't happening in Firefox on Windows. I've reported to the bug to Mozilla along with a testcase (Bug 707623), lets hope it get's fixed soon.

Access your localhost from inside a virtual machine

If you develop on Linux or Mac, and you care about supporting IE, you've probably had to deal with running a Windows VM for testing. However to access your computer's localhost from inside the VM you generally have to use your computer's IP address (since localhost now refers to the VM's localhost) and this can cause a number of things to break if you don't change your website's base url. This is quite annoying because every time you go to test something in IE, you have to remember to change the base url as well. This gets even more annoying if your IP address changes.