Detecting mobile devices with Javascript

Today at work we were struggling with a way to detect the iPad and similar devices without relying on the browser user agent string. We ended up checking the value of window.onorientationchange like so: function is_mobile_device() { if (typeof window.onorientationchange != "undefined") { return true; } else { return...

Read More

Mount your ntfs drive on boot in Ubuntu

So you’ve got an NTFS drive you want mounted when your Ubuntu machine boots? Time to pull up your favorite editor and modify /etc/fstab. This is what I ended up with: /dev/mapper/sil_aiaiahddacai1 /media/Storage ntfs-3g defaults,gid=1000,uid=1000,locale=en_US.UTF-8 0 0 Replace the gid and uid values with the ids of your group and user. Run id to get these values. I also had to make sure I...

Read More

Music for coding – Trentemøller

Music for coding – Trentemøller

Anders Trentemøller [1][2] produces some awesomely deep, dark and incredibly edgy electronica that makes for some great coding music. If you haven’t listened to this fantastic Scandinavian artist, I’d recommend you give him a listen. I really like Moan from his debut album The Last Resort. You can buy the fantastic Trentemøller – The Digital Chronicles on...

Read More

upaste

After a brief and torrid affair with Fedora, I gave up and threw Ubuntu 10.04 on my home desktop. One thing that I missed from Fedora was the fpaste utility. This handy little command-line tool lets you paste the results of your shell commands to fpaste.org, a semi-official Fedora pastebin. After realizing that pastebin.com had an open API, I took it upon myself to write a little Python script...

Read More

Vim

Vim

So I recently started using Vim as my text-editor of choice. I used to hate Vi with a passion, but lately I’ve grown frustrated with the bloated, laggy IDE’s of today, so I turned to Vim. Vim is a super lightweight text-editor that you run from the terminal. The command syntax made no sense to me at first, but slowly I started to learn the basics and soon I was working along as fast...

Read More