't Bijstere spoor

't Bijstere spoor

A blog about Web development

OS/X terminal settings for linux programmers

Updating the keybindings again for the terminal did the track. I now have working home, end, page-up and page-down keys.

If you don't feel like messing around with the settings, you can download my settings here:

Evert.terminal

It also makes it black on white, and a bit of transparency; if you don't like that, you can always put that back to normal. The old behaviour of the mentioned keys can be used by pressing shift along with the key.


Leopard first impressions and problems

I don't want to sound like I'm complaining too much, because I actually really like the new version of os/x. I wanted to cover a bunch of problems so people might know its not just them.

First, my personal favourite improvements.

The terminal

I'm especially happy that some time was spent improving the terminal application. Half my day I spend in that application, and any small improvement is welcome there. The most important being tabs (yessss) and an always running ssh-agent (which integrates with the keychain).

I ran across a bunch of problems as well ..

Flash upload stops working

Since we deal at FileMobile a lot with uploads of large/huge files.. we use a Flash uploader. It completely stopped working in leopard and from what I hear an update of the flashplayer is in the works.

Windows magically disappear using spaces

Spaces is a nice tool and i feel like it could help productivity.. but when you're switching between a few spaces sometimes windows get completely lost and the applications need a restart to re-appear.

Terminal won't change the background color

I'm fairly sure this has to do with the fact that I used a background image for my terminal in tiger; which is a feature that has been removed in leopard. I really dislike the default black-on-white, but I couldn't change my background color anymore. The solution for this was to simply remove:

Library/Preferences/com.apple.Terminal.plist

From my home directory.

My key-bindings for page-up and page-down are lost in the Terminal.

I haven't felt like trying this yet, but I assume I simply have to follow my previous steps, if not.. I'll post about it later..

Airport up and down

Not sure if this is the OS or the airport, but its been shaky.. Hope this gets improved with an update of some sort.


HTML Purifier rocks!

HTML purifier

I had to create an RSS aggregator for my job, and I had to find (or create) a good tool that sanitizes the HTML that comes in. I stumbled upon HTML purifier, and I haven't seen a better tool for the job yet.

Some of the features:

  • It can turn the html into valid XHTML (transitional or string)
  • So it also balances tags out..
  • Removes any code that could expose a security risk. (tested with RSnakes XSS cheatcheat).
  • Allows you to truncate HTML (if you don't want to show an entire post) and still results in proper HTML!

So yea, if you need something similar; I'd suggest you check it out..


SabreAMF documentation

Finally I managed to get some time to whip up a central place for SabreAMF documentation.

All in google code. I have to say I didn't really like their wiki too much.. its a bit minimal on syntax and differs from dokuwiki syntax, which I'm used to. But the goal is more important here; centralization of the SabreAMF project.


SabreAMF 1.0-beta2

Found a bug in the AMF3 deserialization.. this is fixed now.

Download beta2

Thanks Theo Hultberg for finding this.


SabreAMF 1.0-beta

I just finished work on a 1.0 beta release for SabreAMF.. These are the notable changes:

  • SabreAMF_Client now has a setEncoding method, allowing you to easily test AMF3 services.
  • Bugfix in AMF3 handling (the AMF3 wrapper wasn't automatically removed)
  • Bugfix in handling of DetailExceptions
  • Date objects coming from flash/flex are now automatically mapped to PHP5.2's DateTime object.
  • So yea that last one breaks backward compatibility if you already make use of dates and bumps up the minimum PHP version to 5.2

If you feel compelled to run this on 5.1, here's a fake DateTime class you can use as a replacement:

<?php
class DateTime {
 
   private 
$time;

   function 
__construct($datestring) {

      
$this->time strtotime($datestring);

   }

   function 
format($dateformat) {

      return 
date($dateformat,$this->time);

   }

?>

And last, but not least.. there's now a Google code project. You can find the SVN repository and downloads there. There's also a bugtracker and a place where I'm going to write documentation (with your help?).

I'm excited about the 1.0 release. SabreAMF has been 'alpha' for almost two years. Even though it has been working fine I do get a lot of questions like "when is it going to be released?". It feels like closing a chapter =).


PHP's DateTime object and unix times..

Just started checking out PHP 5.2's DateTime object. Its great to have a 'standard object' for dates.. Lots of the frameworks out there all define their own date class, perhaps this can help creating more generic interfaces.

Its quite hard to find the documentation though. I'm looking for a way to create a DateTime object based on a unix time, but this seems to be the only way:

<?php

// unix time
$unix time();

$dateTime = new DateTime(date(DATE_ATOM,$unix));

?>

Which is a pretty nasty hack, because the strtotime()-like parsing is unnecessary because the actual date is likely stored as a number anyway..

Update: kore pointed out the proper way to do this in the comments.