projects

  • advisable

    Advisable is a JavaScript library for Node and the browser providing functional mixins for both async and sync aspect-oriented advice.

    // advisable-example.js
    var advisable = require('advisable');
    
    var arithmetic = {
      add: function (x, y) {
        console.log('arithmetic.add');
        return x + y;
      }
    };
    
    var logBefore = function (x, y) {
      console.log('before, args => x: %d, y: %d', x, y);
    };
    
    var logAfter = function (x, y) {
      console.log('after, args => x: %d, y: %d', x, y);
    };
    
    // Mix in advice behavior
    advisable.sync.call(arithmetic);
    
    // Demonstrate before and after logging with around advice
    arithmetic.aroundSync('add', logBefore, logAfter);
    
    // Perform the addition
    z = arithmetic.add(2, 3);
    

    Running the script shows the logging advice:

    ➜ node advisable-example.js
    before, args => x: 2, y: 3
    arithmetic.add
    after, args => x: 2, y: 3

    View on GitHub

  • invoke

    Invoke is my take on async JavaScript control flow for Node and the browser.

    // Given an async db api:
    //
    //   db.find(id, callback)
    //
    // And an async data aggregation function
    //
    //   aggregate(x, y, z, callback);
    
    var invoke = require('invoke')
      , db = require('db')
      , aggregate = require('aggregate');
    
    // Fetch three records in parallel, then aggregate
    
    invoke(function (initial, callback) {
    
      db.find('id-0', callback);
    
    }).and(function (initial, callback) {
    
      db.find('id-1', callback);
    
    }).and(function (initial, callback) {
    
      db.find('id-2', callback);
    
    }).then(function (results, callback) {
    
      aggregate(results[0], results[1], results[2], callback);
    
    }).rescue(function (err) {
    
       // Handle any errors by logging to console
      console.error(err);
    
    }).end(null /* initial data */, function (result) {
    
      // Log result
      console.log('result: %d', result);
    
    });
    

    View on GitHub

  • SoundBite for Songbird

    SoundBite for Songbird is an add-on to the Songbird media player that uses audio similarity measures to create automatic “sounds like” playlists and enable map and network-based interactive navigation of music libraries.

    Learn More

    Fans of charts and graphs may want to dive into my my master's thesis

  • BirdPlaydar

    Birdplaydar exposes the Playdar music content resolver service to Songbird add-ons. The Birdplaydar search page lets you search for tracks using Playdar resolvers, which search your computer, your local network, and internet sources like Last.fm. It doesn’t matter where the track actually is; if Playdar can find it, you can listen.

    Learn More

  • LetsIgnore

    In addition to my music obsession, I like to run long distances. The go-to spot for competitive running discussion is LetsRun. LetsIgnore is a Firefox extension that improves the user experience on the LetsRun message boards by allowing you to ignore threads, ignore other users, and ignore ads embedded in the board.

    Learn More

  • Category Shuffle

    Inspired by album purists, Category Shuffle enables Album Shuffle, Artist Shuffle, and other less frequently requested shuffle groupings (Year Shuffle, anyone?) on Songbird media player.

    Learn More