HOWTO let it snow in <canvas>

I’ve been experimenting a bit with the <canvas> tag. And hey, what’s a better way to use it right now than to make a browser screen full of snow? It even works in Internet Explorer (using excanvas) although pretty slow. For best results view in your favorite non-crappy standards compliant browser.

View a demo here. And if you want to tinker with it, download the sources from Google Code (open source under the MIT/X11 license).

Want to learn more about the <canvas> tag? Try this tutorial from diveintohtml5.org or the one from Mozilla.

Merry christmas!

Rotate buttons don’t work in WordPress 2.9

Wondering why those cool ‘image rotate’ buttons you’ve seen in the WordPress 2.9 video aren’t working on your installation? They apparently depend on a PHP function which isn’t very widely available, and hence, they don’t show up.

I’ve created a ticket for this bug in WP’s bug filing system, so go there and vote for it so the developers can fix it in 2.9.1!

The Twol: now available as a terminal (cli) command

cli

I wrote a little shell script that enables you to query The Twol (you know, my little pet project that provides instant information on lots of things) from the terminal (command line interface).

So, now you can do stuff like:

» Translate sentences from English to German (and many other languages)
twol translate en de I would really like a nice cold beer

» Get the weather for virtually any city in the world
twol weather St. Petersburg, Russia

» Check if a Twitter username is still free
twol twitterusernamefree stevejobs

Right from the command line (under Mac OS X and Linux at least :)

You need PHP to run the script. In Mac OS X that’s included out of the box, under Linux you might need to install php5-cli or another package with a similiar name.

Then you can simply:

  • download the script
  • copy it somewhere in your $PATH
    cp twol /usr/local/bin
  • make it executable
    chmod u+x /user/local/bin/twol
  • have fun!

Photo credit: *n3wjack (CC-BY-SA)

Kaart van kringloop (afvalscheidings) punten in Utrecht

In sommige delen van Utrecht wordt het oud papier wekelijks opgehaald, maar helaas is dat dus niet overal het geval. Daar moet je namelijk je afval zelf scheiden bij zogenaamde kringlooppunten waar bakken zijn voor oud papier, glas en soms textiel.

De website van de gemeente bied wel een overzicht aan van alle kringlooppunten in de stad, maar helaas zijn dat alleen maar de straatnamen en is er geen kaartje. Misschien dat u een echte Utrechter (nee, geen Utrechtenaar) bent en al die straten uit uw hoofd kent, maar ik niet. Vandaar dat ik dus maar zelf een Google Map heb gemaakt met alle kringlooppunten in Utrecht Oost. Vul gerust aan, of maak uw eigen kaartje met uw favoriete kaartentool.

Naschrift: met dank aan ‘mulder’ hieronder in het commentaar: er is wél zo’n kaartje te vinden, via de website van GemGids. Onbegrijpelijk dat de gemeentesite daar geen linkje naar heeft geplaatst op de eigen site.


Kringloopstations Utrecht-Oost weergeven op een grotere kaart

Backup your tweets with BackupTweets

logo

Twitter is a typical example of a cloud service. Unfortunately, having all your tweets in the cloud instead of on your hard drive has a large drawback: things can go wrong. A few days ago T-mobile subscribers lost all of their data because of a large server outage at Danger, a Microsoft subsidiary. Something like that could happen at Twitter too, meaning that all of your beloved pieces of 140-character poetry are gone.

Furthermore, Twitter has an artificial limit in place that limits you to viewing your last 3,200 tweets. I’m an avid user of Twitter myself, and seeing my number of tweets rapidly reaching to the 3,200 limit i set out to do something about it and backup my tweets.

There are several solutions for doing this. But many of these didn’t fit my needs. Most of them require you to enter your username/password, which isn’t a very cool thing or are a bit clunky in their user interface.

So, i wrote something myself called BackupTweets. It’s completely open source (GPL-licensed), so you can download the whole package and run it from your own web server. The only thing you need is a web server running PHP.

You simply enter your username/password and press ‘GO’. The application will fetch all of your tweets in their original format (straight from the API) and save them as a big JSON file (for archiving and later processing), but also as a handy HTML file.

If you’re comfortable with entering your username/pass you can check out the demo. If you’re not you can download the whole package as a zip or check out the source code directly from Google Code.

Flickrstreamr v0.3 released

I’ve uploaded the newest version of FlickrStreamr. FlickrStreamr is a tool to view a continuously updating stream of all recently uploaded photographs from Flickr. On a normal day, around 3000-6000 photos are uploaded to Flickr every minute. This tool lets you view those photographs in a way that is a little bit more sophisticated than hitting ‘reload’ on the recent photographs page on Flickr.

I’ve done a lot of work on making this new version more easier to use, with a less cluttered interface. There’s just one button right now: play/pause. Hit it, and watch the photographs refresh, hover over a photograph to view a preview or click it to go to the photo page on Flickr.com

I’ve added some JavaScript that adjusts the number of thumbnails on your screen. The larger your screen resolution, the more thumbnails you will see. So, you don’t need to scroll the FlickrStreamr page to view more thumbnails. When all thumbnails are updated, the new thumbnails simply update again at the top-left corner.

You can try FlickrStreamr or download the source code and run it for yourself (you’ll need a Flickr API key though).

Better than Time Machine: backup your Mac with rsync

We al know we need to make backups. Apparently, 30 procent of all computer users lose all of their files sometime in their life. Not a pretty foresight.

Fortunately, Mac Leopard users have a program called Time Machine that makes things a lot easier. But is Time Machine the perfect backup solution? I don’t think so. There are a couple of things that make Time Machine very unsuitable for me:

  • You need to get a seperate external hard drive that can only be used for Time Machine (and has to be formatted first)
  • That drive has to be formatted in HFS+, hence, without any (commercial) third-party plugins it’s not readable on Windows or Linux systems
  • You have to leave your drive on all the time to make sure Time Machine makes backups
  • You can’t make a list of things you want to have backed up, you can only exclude folders from your complete hard disk
  • Time Machine makes an exact copy of your hard drive

Especially that last ‘feature’ is very irritating to me. I have an external drive with about 300G of files, including lots of music and video files. My MacBook drive is only 80GB big, so i can never have the complete contents of my external drive on my MacBook. Let’s say i have 10GB of MP3 files, which i backup with Time Machine, then i remove about 5GB of files from my MacBook to free some space. What happens when the next backup round is happening? Exactly, the 5GB of files get deleted from the external disk as well. When i want to play a certain MP3 file from my external drive i now have to ‘restore’ and ‘look back in history’ to find it. Not very user-friendly.

Luckily, there is a very good (free) alternative to Time Machine that does exactly what i want with backups: it lets you specify which folders you want to backup, it doesn’t delete things on the backup drive when you delete files from your original drive, and it’s compatible with any external drive and can even backup files over a network. This piece of software is called rsync. Here’s how to use it.

Read the rest of this entry »

» An overview of all articles can be found in the archive.

Hi! I'm Hay. I make art, do projects and blog here. Read more »

Projects

More Hay at...

Archives by month