Martin Ström

CSS is in progress

Push notifications for Things Touch (iPhone/iOS) using Prowl

While waiting for Things Touch to officially support push notifications I hacked my own solution based on Prowl and my own Ruby library for Things, things-rb.

Installation

  1. I’ve setup Dropbox to share my Things database betweeen my laptop and a computer at home which is always online.

  2. Buy and install Prowl on your iOS device.

  3. On the home computer/server, install things-rb:

    $ (sudo) gem update --system # if you're on an older RubyGems version
    $ (sudo) gem install things-rb

  4. ..and the prowl gem to talk to the Prowl API

    $ (sudo) gem install prowl

  5. Save this file somewhere (like ~/bin/prowl_things.rb)

  6. Setup a cronjob to run the script as often as you’d like. Mine runs every weekday at 8:45 am.

    45 8 * * 1-5 /usr/bin/ruby /Users/me/bin/prowl_things.rb


Nicer public Dropbox URLs

I use Dropbox but wanted nicer URLs for the links I sometimes send to the files in my Public folder. Each user has a folder on dropbox.com which is publicly shared, like this http://dl.dropbox.com/u/12345/ so I just set up a new sub domain (mine is dropbox.my-domain.se) and let Apache redirect all requests to that domain to my Dropbox folder instead:

<VirtualHost *:80>
  ServerName  dropbox.my-domain.se     
  RewriteEngine on
  RewriteRule ^(.*)$ http://dl.dropbox.com/u/27215$1 [R,L]
</VirtualHost>

Download torrent files from Twitter DMs

Here’s a simple ruby script to download torrent files in Safari sent to you/an account as URLs in Twitter direct messages.

It could be used on your home server to download torrent files you send to it from something like your iPad.

I’ve set it up to run every fifth minute (using cron) to check for new files, but can of course be adjusted to something that works for you.

Also, make sure to point Safari’s download folder (in Safari’s preferences) to the same folder as you have Transmission automatically watch for .torrent files so the download actually starts.


Paperclip processor to turn images into grayscale

We wanted to automatically create a grayscale version of the uploaded images for a current project. Here’s the Paperclip processor we’re using:


A better Mail-to-Things-ToDo script

Until now I’ve been creating todos in Things from Mail messages in OS X using the quick entry built into Things and the “autofill” feature. But I didn’t like that it, by default, created the todos in Things’ Inbox and that I had to manually select text in the mail message to get it as notes (which is important when using Things on your iPhone/iPad when the link back to the mail message doesn’t work).

Instead here’s an AppleScript which will take the selected message(s) and automatically create one task for each email in the “Next” focus in Things. It will then archive the mail messages and show a Growl notification. The todos in Things will get tagged with the “Reply” tag (which in my setup is a subtag of “Email”).

The script is a modified version of the one found here. I also put the script in an Automator action like described in the article so you can assign a shortcut key to it without including third party software.


QuickTip: Change Finder’s default folder

#protip: Change Finder’s default folder to one you often use (like ~/Projects or whatever) http://bit.ly/deofQtless than a minute ago via Tweetie


Open Selected Folder or File in TextMate from Finder

QuickSilver

Before upgrading to Snow Leopard I had a QuickSilver trigger (⌃⌥⌘M) to open the currently selected file(s) or folder(s) in TextMate. It was setup as a QuickSilver trigger using the Proxy Object “Finder Selection”. Too bad it doesn’t work for me in the later QuickSilver versions and/or Snow Leopard.

I missed this trigger so I made a 10.6 Service to accomplish the same task:

Automator

  1. Run Automator and select “Service” from the template chooser.
  2. Select “Files and Folders” from “Finder”
  3. Find the “Open Finder Items” action from the left pane and select TextMate as the application.
  4. Save the service in ~/Library/Services. I called mine “Open With TextMate”

Keyboard Preferences

To run the service from the keyboard, run “System Preferences” and select “Keyboard”, then select “Services” in the left menu and locate the “Open With TextMate” service on the right side. Add a keyboard shortcut (I choose the same as I’m used to, ⌃⌥⌘M).


CopyPasteCharacter iPhone Application

A couple of weeks ago our official iPhone application for CopyPasteCharacter.com finally became available on the App Store. The project itself isn’t too complicated but was my first “real” Cocoa and iPhone app so it took some time to get everything together and learn how to do things.

The application basically lets you find and easily copy symbols, characters and letters which otherwise can be hard to find on a regular keyboard. On the iPhone, many of these characters aren’t available at all by just using the system keyboards. Just touch one or many symbols to automatically copy them into your clipboard and paste them into any application (SMS, Facebook, Twitter, Mail etc).

I was happy to see that the app was approved by Apple only two working days after I submitted it. I had, however, waited about 2 months to hear from Apple on how we should solve a problem with my iTunes account.

Hint: You can’t use the same Apple account to upload/sell music in the iTunes Store as upload upload applications to AppStore. Create a new account before buying the iPhone developer program to stay out of trouble.

Please check out the product page with a video walk through or go directly to the AppStore.


Automatically iChat complete Transmission downloads

Lets say you have an extra computer at home which can be used to download Linux distros using Transmission on Mac OS X. Here’s how you can let the computer iChat you when a download is complete.

  1. Sign up for a new iChat screen name and add your normal user as a buddy.
  2. In Transmission, open Preferences → Transfers and set the folder for incomplete files to something different than the “Default download location”.
  3. Start Automator (in /Applications) and create a new workflow
  4. Add the “Run AppleScript” action and paste in this code (replace YOURBUDDY with the scree name of your own iChat account:
  5. Save as a plugin and choose “Folder action” in the “Save As” dialog. Select the folder you setup Transmission to use as the “Default download location”.
  6. Done! The script should now send you an iChat message whenever a new file is added to the folder.

I created this setup a pretty long time ago and still use it, but these days together with a Growl notification plugin that also twitters me when the download is complete.


Screencapture in Mac OS X from a SSH session or launchd jobs

If you’d ever need to use the screencapture command from a scheduled job (like launchd in OS X) or from a SSH session, you might find out that it doesn’t allow you to do that since you’re not the logged in user.

To work around that, run the scheduled jobs as root and exec screencapture like this instead: