You're viewing all posts tagged with technical

Convert LDAP data to CSV

This script reads LDIF data from STDIN and outputs as CSV:

https://gist.github.com/674203

Facebook mini-app with notification badge

While I don’t sit around on Facebook at work (wink wink), I wanted a way to be able to instantly get Facebook notifications without too much interruption (without alerts swamping my inbox or the Facebook page open).

Ideally I wanted a little Facebook app in my dock with a badge icon. Fluidapp is great for this. The normal Fluidapp with the standard Facebook website displays the number of unread messages. But I wanted my notifications displayed on the dock badge too.

Here’s how I did it:

  1. Create a Facebook app from the iPod Touch Facebook website, using Fluidapp:


    You should then have a brand spanking new little Facebook app available from your dock:



     
  2. Next, to enable the badge notifications, we need to create a new userscript:

    Click the “Script” icon (second from the end) in your new app and go to “New userscript…”

     
    After entering a name, it should open the script in your text editor. Copy and paste in this script:
    https://gist.github.com/8c47b77bfd30cb23d343

    You’ll then need to enable your new userscript by selecting “Manage Userscripts” from the menu again, and enabling it:



  3. Finally, reload the page (CMD+R) or close and re-open the app. Every 5 seconds the script will check for new notifications, and display them in the dock icon. Cool!

     

Enjoy!

Open local files in Google Docs by double-clicking

I’ve started using Google Docs a lot recently, but one thing annoyed me: I wanted to have documents open in Google Docs just by double-clicking them in Finder.

The APIs are pretty good, so I’m surprised nobody has written a native app to do this. While I don’t have time to write a native app, I was able to whip up something thanks to googlecl and Apple’s Automator.

Opening local files in Google Docs by double-clicking (in 3 easy steps)

The following solution will allow you to open documents in Google Docs by double-clicking them. The document will be uploaded and opened. If the document has already been uploaded (matched by filename), it will just be opened.

  1. Install googlecl, the command-line interface for Google APIs. This is easy with on Mac OS X with Macports:

    sudo port install googlecl

    Don’t forget to authorise your Google Account with the tool. You can do this once from Terminal by just doing:

    google docs list

    (Then follow the instructions)

  2. Download the shell script.

  3. Create an application, and associate files to using Apple’s Automator.

    Set up the actions as per the screenshot here, and paste in the contents of the shell script:


    Go to File->Save As… and save it somewhere as an app.

    You can now open documents with this application. Simple right-click on a document, and go to Open with -> Other. Browse to find your newly-created application.

    If you want to open all documents like this, click the “Change All” button.

And that’s it!

It works! Yay! Bear in mind I slapped this together in the last hour. I might make it slightly more elegant if I get the time (or you can).

Follow me on Twitter!

My Spotify wish list

Spotify wish list - the easy stuff

  • Play counts
  • Sorting by “album” automatically sorts by “album” first then “track number” second
  • Persistent play history (so I can go back to that awesome party list of queued tracks from a week ago)
  • CTRL/CMD+Clicking stop button stops play after current track

Spotify dream list

  • “iTunes Genius” competitor (to replace the crappy radio)
  • Star ratings (iTunes-compatible)
  • Tree-based playlists (aka Folders)

Giving out passwords over the phone using the phonetic alphabet

In my job I’m often required to generate passwords for clients. One of the common ways of supplying it to them is over the phone because it’s quick and (mostly) secure.

But it can be painful at times. People can easily mishear the spelling, which is why we turn to the ICAO spelling alphabet (or “NATO phonetic alphabet”). The problem is that I’m not enough of a radio guru to have memorised the entire alphabet yet. So I wrote this handy tool to help me:

Phonetic alphabet helper
https://dans.im/phonetic-phrase-gen.php

Simply input the word and it prints the phrase to read out over the phone, using the phonetic spelling alphabet:

After a few more password reset requests, I’m hoping I’ll be able to memorise all those words and make the radio veterans proud.

Enjoy!