jerakeen.tumblr

I'm Tom Insam and I still can't decide where I want to host my content. More about me.

Delicious bookmarks counter in JavaScript

This is a script I use on a few sites to automatically count the number of delicious links to various urls. There are a few of these that I’ve found, but I quite like writing JavaScript like this. Also, mine will combine as many urls as possible into a single request to the delicious API, because it’s faster that way.

<!-- jquery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<!-- this is md5 implemented in javascript -->
<script src="http://pajhome.org.uk/crypt/md5/md5.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {

  // This function gets called per link, this depends on the template.
  // In my case, I'm walking up to the surrounding 'post' object, then
  // down to a pre-prepared p tag I want to populate with link data.
  // You will want to change this if you use this code.
  //
  // Markup is approximately:
  //
  //   <div class="post">
  //     <a href="..." class="delicious">..</a>
  //     <p class="deliciousinfo"></p>
  //   </div>
  function markup_delicious_link( element, data ) {
    var html = "<a href='http://delicious.com/url/" + data.hash + "'>";
    html += data.total_posts + " delicious link(s)";
    html += "</a>";
    element.parents(".post").find(".deliciousinfo").html(html);
  }

  // Find all links with class 'delicious'
  var hashes = [];
  var elements = {}
  $('a.delicious').each(function(index, link) {
    if ($(link).attr("href")) { // sanity check
      var hash = hex_md5( $(link).attr("href") );
      elements[ hash ] = $(link);
      hashes.push( "hash=" + hash );
    }
  });

  // Make calls to the delicious feed API to get details
  while (hashes.length) {
    // delicious permit a maximum of 15 hashes per request
    var subsection = hashes.splice(0, 15);
    var url = "http://badges.del.icio.us/feeds/json/url/data?";
    url += subsection.join("&") + "&callback=?";
    $.getJSON( url, function(data) {
      for (var i=0; i<data.length; i++) {
        var $link = elements[ data[i].hash ];
        markup_delicious_link( $link, data[i] );
      }
    });
  }

});
</script>
Mark:
It's the '00s now right?
Tom:
yep.
Tom:
still.
Mark:
Does that mean I can telecomute my flipping out?
Tom:
No, that was early '00s.
Tom:
now you just outsource it.
Mark:
No, that was the mid '00s
Mark:
Now you crowdsource it
Mark:
you let your users flip out for you

Automagic: Love Footage And Tools Demo | Rock, Paper, Shotgun. Love looks so pretty. And crazy, of course.

Los Colorados - Hot & Cold

Things my colo does

Been looking into getting rid of my colo. It costs a non-trivial amount of money, and philosophically I rather feel I should be able to exist in the cloud by now.

  • It hosts my SVN repository and clones of some of my git repositories.
  • It serves jerakeen.org
  • I run irssi in a screen session as an IRC client. This will be hard to replace.
  • I run some perl-based IRC bots from it.
  • I back up my mail to it using offlineimap
  • Some friends have accounts and host simple web content / mail / irssi sessions on it. If you run a colo, don’t give friends accounts ever, for any reason. This one right here is probably the biggest barrier to me getting rid of it. But don’t take it personally if that’s you..

Things it doesn’t do that I’m thankful for

  • Host my mail. Tuffmail rock. But everyone I know already knows this.

Singularity

Don’t be late for the singularity. Once your mates get their brains uploaded, if you wait a week they’ll have experienced years of virtual time, and will have entirely forgotten about you. And you won’t know any of the in-jokes.

Don’t be early, either. I expect we’ll get the ability to upload brains (let’s assume it’s possible) well before we’ve invented computers that are independent and self-repairing enough that you’d trust them with your newly-immortal self. I can certainly see several singularities starting and burning themselves out almost immediately. Pick the wrong one and your best-case-scenario is to be stuck in obsolete and unreliable hardware for the rest of time.

Sure, the desktop revolution was inevitable. But that doesn’t help the people who invested in Be. Or those that invested in Microsoft in 2001.

Huh, there’s an iPhone tumblr app.

volume widgets

The iPhone / iPod music player volume widget behaves like this - you have to start your finger drag on the little round nubbin. You then drag it left or right. Dragging your finger up or down off the slider doesn’t adjust the volume, but doesn’t cancel the adjustment either, and I’ve found this to be a nice way of adjusting the volume a tiny amount - dragging diagonally increases the distance that you have to move your finger to effect the same change in volume, so it’s more precise.

If you put your finger anywhere else on the volume widget, nothing happens. If you drag your finger onto the nubbin from somewhere else you don’t start changing the volume.

The video player and YouTube volume widgets work the same way.

The iTunes Remote volume widget works like this - the volume will snap to wherever on the slider you put your finger down. Once you’ve done this, dragging the slider works as in the local music player. It looks identical to the slider in the music player app.

A slider control put into a blank view in Interface Builder works like the remote application - the slider position snaps to where you touch the slider. But it looks different from the volume control slider - the IB slider has a matte, concave look, wheras the volume control has a shiny nubbin.

The ‘Brightness’ control in the settings app is a slider that looks and behaves like the Interface Builder slider.

On the whole, I prefer the behaviour of the remote app, with the snap. And I prefer the appearance of the Brightness slider. But it’s odd that there are already three different slider widgets on the iPhone.

Skitch

Have you noticed how elegant yet obvious Skitch screenshots have become? For instance. I see them everywhere, and you can always tell it came from Skitch. Used to be that I’d have to open a blank web browser or something to serve as a backdrop for screenshots. Now I just need to make sure my wallpaper is suffficiently classy. Which is fine, I haven’t seen my desktop wallpaper in months, I always have windows open.

Skitch still needs a ‘blur’ tool for anonymizing stuff, though..

Polite Interfaces.

The &#8216;your trial has expired&#8217; dialog for Spanning Sync (which syncs your iCal and Google Calendar calendars, very nice) offers to uninstall the application as an alternative to paying for it. How wonderfully polite.

Polite Interfaces.

The ‘your trial has expired’ dialog for Spanning Sync (which syncs your iCal and Google Calendar calendars, very nice) offers to uninstall the application as an alternative to paying for it. How wonderfully polite.

iPhone 2.0 calendar app

I like the improvements made to the 2.0 iPhone calendar app. Mostly that the calendars are now copied across as individual calendars with their own colours. But Shawn Blank says that they come across with the same colours as their desktop counterparts, and I’m not finding that to be the case - all my phone calendars are different colours. It’s really really confusing to have utterly different event colours on the phone.

Which is pathetic. Already, I’m now finding things that are utterly trivial to be annoying. On any other platform, I’d be astonished that the calendar application worked, let alone that it can keep track of 15 different calendars, sync them perfectly in 2 directions, etc (ok, so maybe I use too many linux handhelds). On the iPhone, I get annoyed that things are a different colour.

Update: From playing with over-the-air sync and mobileme, colours seem to be synched properly if you’re using mobileme but not if you’re using iTunes to do the sync. Weird.

Searchable list with new entry adding. Lovely metaphor, must steal it for herejustnow. From the OmniFocus for iPhone screencast.

Searchable list with new entry adding. Lovely metaphor, must steal it for herejustnow. From the OmniFocus for iPhone screencast.

Next/previous controls.

Only the web browser has these buttons, not &#8216;real&#8217; apps. Jumping between form fields is sometimes tricky. I miss them.

Next/previous controls.

Only the web browser has these buttons, not ‘real’ apps. Jumping between form fields is sometimes tricky. I miss them.

A herejustnow iPhone app. I&#8217;m having to learn Objective-C to do this, which I can just about put up with. CoreLocation turns out to be quite easy to use, too. Now all I need is the ability to install the thing on a Real iPhone.

A herejustnow iPhone app. I’m having to learn Objective-C to do this, which I can just about put up with. CoreLocation turns out to be quite easy to use, too. Now all I need is the ability to install the thing on a Real iPhone.

More Information