The Hit List Forever

22/01/2010

Let me get the cheesy redundant joke done right off the bat:

On top of my list of things to get done is to finish Dave Allens Getting Things Done.

How droll. What fun.1

On top of the personal hit list of Andy Kim of The Potion Factory I’m willing to bet a few shillings you’ll find “Finish The Hit List Touch”, the fabled iPhone companion app to The Hit List Mac. I’m not sure that’s sound prioritizing though. I think perhaps he should bump up “Reconsider customer communication strategies” to number 1.

If you’re unacquainted with the app, its history and the state of things today, let me offer a brief summary.

Read the rest of this article »

  1. And in my case actually the plain truth. I’m still halfway through after trying both dead tree and audiobook. For now I’m settling for getting something done.
3 Comments

Better (AS3) imports in TextMate

1/12/2008
Summary: In which Martin has concocted a hack to make importing packages in TextMate a wee bit easier.

TextMate TextMate TextMate. I might as well make this a pure TextMate blog soon, but I can’t help it. My love for this app is overwhelming.

I spend a lot of my time writing ActionScript, and one thing I’ve always envied users of Flex Builder (Which I avoid if I can) and FlashDevelop (which isn’t available on the Mac) is the auto-importing of classes, I.E. when you type

1
var s:Sprite;

the IDE checks whether that class is already imported, and if not imports it.

Now, what I’ve managed to do still isn’t even close to that functionality and let me say right away that the meat of this trick is the excellent work by the creator of the ActionScript 3 bundle for TextMate; Simon Gregory et al.

Simon has in his bundle included a ‘Auto complete imports’ command which searches both the packages in your project and the packages included from Adobe (flash.*) which makes it easy to get completion for any class you’d want to import.

Like so:

  • You want to import the
    1
    flash.net.URLLoaderDataFormat;

    class, which is a long-ass line to type out.

  • Instead you type ‘URL’ and trigger the auto-complete command. You’ll get a drop-down with all classes starting with “URL” and then choose the proper one.
  • 1
    import flash.net.URLLoaderDataFormat;

    is typed out for you. Yay!

However, now you have to copy that text, move on up to your import statements, paste it and then find your way back to where you were.

Boy do I wish I knew Ruby well enough to actually just augment that command to make it obey my wishes, but alas; My ruby-Fu is weak and so I turned to the weapon of the feeble TextMate hacker; Macros.

Basically the workflow now is:

  • Perform the steps as mentioned above to get the completion for your import. However; This time the output would be
    1
    import flash.net.URLLoaderDataFormat; move

    . The ‘move’ at the end there will work as a tab trigger for the macro, so the next step is to press tab, and then (hopefully) the import statement is moved up to it’s brethren, and you end up back where you were. Here’s how it works.

  • When you press tab you trigger the macro which will perform the following steps:
  • Select the line with the import and cut it.
  • Enter the word ‘asdf’ in place of the import statement.
  • Search for the last occurrence of the word ‘import’ in the document.
  • Move to the line below said last import.
  • Paste the import statement from the clipboard and indent it properly.
  • Search for ‘asdf’ in the document and delete it, leaving the caret at the position it was when you launched the macro.

Like I said; It’s more of a hack than anything else and if someone comes up with a proper solution please let me know. The main weaknesses here are:

  • You can’t just hit the combo in the process of typing out a statement. If you trigger the auto completion at the word ‘Sprite’ in
    1
    var s:Sprite = new Sprite();

    The line

    1
    import flash.display.Sprite;

    will end up in the middle of the statement. Likewise if you trigger the combo on the same line as any other code, that code will end up with the imports. The command must be triggered on a line of it’s own.

  • Dependencies: If you want to change the tab trigger to something else than ‘move’ you’ll have to change the output from the auto-complete as well.
  • Not really all that elegant. Having to do two actions (even though one is just pressing tab) seems a hassle.

With all that out of the way: Grab it if you want it!
Zip here.
Please note: I didn’t really want to distribute a modified version of Simons work, so if you want to output the ‘move’ keyword for the tab trigger you need to go into the ‘Auto Complete Imports’ command of the ActionScript 3 bundle in the Bundle Editor and make a miniscule edit at the bottom of the code.

1
2
3
4
5
6
7
8
#Change
else
  print "import " + choice + ";"
end
#to
else
  print "import " + choice + "; move"
end

That’s all folks.

2 Comments

Life hack: On the Job + Marco Polo

24/11/2008

Onthejob
The odds are good that you have to keep track on how much time you spend on any individual project for billing reasons or what have you. If you’re anything like me (and why wouldn’t you be) your fantastic right hemisphere of the brain makes you profoundly sucky at performing this dreary task.
Enter On the job, a quite wonderful little app that’ll do the job for you. However; If you are afflicted to the degree I am with this complete and utter incompetence at important but boring chores, you have difficulties even remembering to open the app to let it do it’s thing. ‘Why Martin, it’s simple’, I hear you exclaim, ‘you just put it in your start-up items, so that every time you start up your work computer it’ll launch the app!’ Well, no. You see, I use a MacBook which I carry between the office and home, and my innate loathing of shit starting up each time I start up my Mac would annoy me to no end. Besides, a more than likely scenario would be me quitting the app when going home and then forgetting to start it up again when I’m back at the office. Yes; I’m that terrible.

I considered this while in the shower, as these things are wont to happen, and came up with the idea of trying to make my laptop sniff out which wi-fi I was connected to and thusly be able to perform certain tasks based on that information. I started trying to work out whether it’d be possible to AppleScript a solution, or whether I’d have to try and apply my nigh-non existing Cocoa skills to pull this off.

Marco Polo
Ask and ye shall receive. Of course, if there’s a good idea to be had, most likely someone beat me to it. Enter Marco Polo.
This absolute gem of an app promises (and in the 30 mins I’ve used it; Delivers) context awareness for your Mac based on a whole load of criteria. For my purposes all I had to do was to make it sniff out the SSID of my office Wi-Fi and launch On the Job whenever the rule matched. I’ll also be setting it up to launch MediaLink when at home so that I’ll instantly start streaming media to my PlayStation. Yet these examples are just the tip of the proverbial iceberg. The possibilities are, perhaps, not endless but certainly numerous. I highly recommend checking out this killer combo, or just Marco Polo if your short term memory is better than mine (not hard) but context awareness might be interesting for you anyway.

On the job is shareware ($25) and Marco Polo is free as in speech and beer.

No Comments