September 2010
2 posts
1 tag
Home & End Keys, Mac OSX
Using Terminal.app on Mac OSX to connect to a Linux/*nix system and work in any text editor (such as Vim) is a bit of a hassle when you are used to the Home and End keys going to beginning or end of line on other systems. Remap the keys in Terminal->Preferences->Settings->Keyboard to the following… End: ctrl+[, [, 4, ~ it should look like this: \033[4~ Home: ctrl+[, [, 1, ~ it...
Sep 30th
1 tag
URL Encode/Decode (Perl)
Snippet of Perl code to URL encode/decode a string… URL Encode: $str =~ s/([^A-Za-z0-9])/sprintf(“%%%02X”, ord($1))/seg; URL Decode: $str =~ s/\%([A-Fa-f0-9]{2})/pack(‘C’, hex($1))/seg;
Sep 30th