Notes to Self, scripts & tips for geeks.
And other potentially useful information.
Articles
-
UK Search Safari Extension
An extension for Safari which redirects searches from google.com to google.co.uk
-
Building OpenCV 2.2 for Snow Leopard
As I found, incorporating the OpenCV image processing library into your Cocoa app is more difficult that it sounds.
-
Adding a Toolbar with Next & Previous above UITextField Keyboard
How to add a toolbar above the standard iPhone keyboard with next, previous & done buttons, as Mobile Safari does when filling in forms.
-
Django Admin Google Maps Location Picker with JQuery
An admin widget for Django which uses Google Maps + JQuery to pick a map location
-
Mercurial avgtag Extension
A Mercurial extension for use with XCode. Updates CFBundleVersionString when adding a tag to the repository.
-
Updating Info.Plist Bundle Version from Mercurial Changeset ID at Build Time
Automatically use the latest mercurial changeset id as CFBundleVersion
-
Using agvtool with Mercurial Hooks to Update XCode Bundle Versions for New Tags
A simple hook for Mercurial which updates the “Bundle versions string, short” (CFBundleShortVersionString) in your XCode project Info.plist each time you add a new tag.
-
Applescript to Toggle iTunes Equalizer Presets
Use this to toggle between settings for desktop speakers and the MacBook Pro’s less capable small speakers.
-
NSIndexPath + NSArray
A category on NSIndexPath which provides serialisation to and initialisation from an NSArray.
-
iPhone Address Book & Google Maps Integration
In iPhone OS, both Phone.app & Contacts.app are able to place special pins in Maps.app showing the location of a contact with a custom named pin & additional contact information in a detail view.
Below are my notes on replicating this functionality.
-
PHP RSS Appcast Generator
PHP 5 script to generate an RSS 2 app-cast from the contents of a folder.
Produces feeds suitable for the Sparkle framework to auto-update your Cocoa Application.
-
Command Line Password Generator
A command line script written in PHP to generate random alphanumeric passwords
-
chmod for Windows
chmod is a command line utility for Unix like systems used to set permissions on files & folders. Windows has a similar utility: cacals.exe
-
Packaging ImageMagick Droplets with Platypus
Using Command Line PHP scripts to control ImageMagick from Platypus Droplets
-
Improved Mail PDF from Safari Script for Mac OS X
Improves on the built-in Mail PDF workflow from the print dialog by setting the filename & message title to that of the foremost Safari window.
-
Overlaying Images with ImageMagick
How to automatically generate a thumbnail with play icon overlay from a movie still.
-
Removing Accented UTF-8 Characters with PHP
Many of the products sold on designer-lights.com from European manufacturers such as Santa + Cole have accented (diacritic) characters in their titles.
The following PHP code replaces the accented characters with their accent-less equivalents. This makes links from pages which aren’t UTF-8 encoded work correctly.
-
Site-Wide Global Variables in Ruby on Rails
and their PHP equivalents.
-
SMTP & POP3 Email for Virtual Users on Debian Sarge
Setting up a Debian server as a POP3 mail host for a collection of domains with MySQL, Exim & Courier.
-
Applescript to Send Selected iTunes Tracks Using Mail
Each track is attached to a separate message. This works well for recipients who have a per-message limit (like Hotmail, Gmail & Yahoo mail do).
-
Save Current Safari Window as PDF
Applescript to save the foremost window in Safari as a PDF. Uses the window’s title for the file name, saves to ~/Desktop
-
Initialising the locate database on OS X
Forcing the first build of the locate database - useful on new systems
-
Using Cron to Restart Fetchmail
The fetchmail daemon sometimes gives up without good reason. The following script should be placed in /etc/cron.quarter-hourly/ or similar to check it’s running. This script assumes your fetchmailrc does not contain a set daemon line, and contains set logfile /var/log/fetchmail.log
-
Making Square Thumbnails With ImageMagick
My PHP script to automatically create cropped square thumbnails (like flickr does).
-
Multiple mod_rewrite RewriteRule Flags
You can add more than one flag to a RewriteRule statement by separating them with commas
-
ImageMagick on OS X / Intel
My notes on building the ImageMagick tools from source on Mac OS X 10.4 / Intel
-
Blocking Inline Text Ads in Omniweb
I find inline text adverts to be abrtusive, anoying and make a site look unprofessional. The adverts are provided by 3rd parties - the ones I’ve come across are from either Kontera or IntelliText.
-
Installing DOSBox on Mac OS X 10.3 (Panther)
Here’s how I got DOSBox running on Mac OS X 10.3 (Panther)
-
SVN Backup Script
This is the script I use to copy my Subversion repositories to a backup server. Each repository is checked for changes before doing the export.
-
ssh-agent with zsh & keychain on Mac OS X
I hate typing in passwords. Everyone hates typing in passwords. When dealing with remote computers there are many many passwords to type in, and that’s why we have SSH with keys.
-
Using .htaccess & mod_rewrite to Redirect Everyone Except Your IP
When you’re updating a website you often want all urls to point to a maintenance page but still have access yourself.
-
Smarty Caching & 304 Not Modified HTTP Header
Using and understanding the 304 Not Modified HTTP Header with the PHP Smarty templating system
-
Copying Between IMAP Servers With PHP
This PHP script will duplicate folders and messages from one IMAP server to another.
-
Building Fetchmail on OS X
Build the command line fetchmail tool on Mac OS X 10.2