Showing posts from August, 2009

Simple canvas 2d physics

We were out playing pool a couple of nights ago. Instead of betting money on the games we used code-hours. I'm not very good at pool so in the end i was lucky to only owe my friend one code-hour.
He wanted me to code a physics "demo" on a canvas element. Since i only had one hour to code we limited the "demo" to 2d and circles :) The implementation is quite ugly and the physics formulas are pretty much taken from an article at gamedev (which i can't find at the moment).

DemoThe result of my code-hour can be found at:

Switching to Blogger

After a couple of hours work I've switched platform to Blogger and it was easier than i thought. As a bonus i upgraded the theme to something with a little more colors. I've got the feeling that my old style (on the image) wasn't optimal, or as Mike put it,
For the love of God, put some style on your links so we can see themWordpress is a great platform with a lot of plugins and features. The only reason i switched was that I just don't have the energy to host Wordpress on my own server. Update to new versions, tweak the skin, fix plugin versions. Some of the posts don't quite work after the switch but i will go through and fix all of them, in time.

Ubiquity Spotify Search

A small Ubiquity command for searching Spotify. To be able to search you must have:
The Spotify application installed on your system.Be able to open Spotify URI's from the browser.Download & InstallThe plugin can be installed and subscribed to at:
The command can be downloaded from the subversion repository at:

jQuery floating header plugin 1.0.5 released

Finally i've fixed some of the bugs with the floating header plugin. I'm very proud that i've actually taken the time to fix these issues.

- Great work Erik!
- Thanks!

The new version can be downloaded from the project page, jQuery or from the subversion repository.

Using tmpfs in /tmp

I've been stalling moving /tmp to RAM ever since i first bought a SSD for my computer last year. Now when i finally got the energy i read a bit about it and it was almost too easy. Just add this line to fstab then restart or run mount -a and it should work.

tmpfs /tmp tmpfs defaults,nosuid,size=1024M,mode=1777 0 0

I'm pretty sure the mount options can be better tweaked. Here is an excerpt from the documentation.
tmpfs has three mount options for sizing: size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs instances the machine will deadlock since the OOM handler will not be able to free that memory. nr_blocks: The same as size, but in blocks of PAGE_CACHE_SIZE. nr_inodes: The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is the lower.