Joining functions in Javascript

I needed a way of adding some extra functionality to some existing functions but without wanting to touch the original functions’ code, essentially joining functions together.

This is what joint.js does.

I ended up making two versions, one for joining more than 2 functions which has more of an overhead, and a simpler one for just joining only two functions.

First include the joint function in your script

function joint(a){var b;return b=a[a.length-1],a.pop(),a=a.length>1?joint(a):a[0],function(){b.apply(new a)}}

Then use it like this;

// My original function that I want to extend
function my_func() {
    console.log( "Original functionality." );
}

// Function with the new functionality
function new_func() {
    console.log( "New functionality." );
}

// Add the functionality of new_func to my_func by joining functions
my_func = joint([ my_func, new_func ]);

// Now run the original function with the new functionality
my_func();

/* CONSOLE OUTPUT:
 > Original functionality.
 > New functionality.
*/

You can download the source on my GitHub here: https://github.com/Dayjo/joint/ or take a look at it working on JSBin

Alternatively you can see this post on coderwall.com here; https://coderwall.com/p/j-cega

Microsoft Bing – Image Search

So I’ve been playing around with Microsoft Bing today, just with the image search, and I actually really like it!

I’m as suprised as you, I really expected something boring, unintuitive and useless. I figured it wouldn’t be really any different to Google’s search, but with worse results.  Au contraire!
Continue reading “Microsoft Bing – Image Search”

Bing – Microsoft’s Last Ditch Attempt at the Search Engine Market


Bing, is the new name for yet another re-launch Windows Live (MSN) Search, the search engine provided by Microsoft as a rival to Google.

Microsoft are launching an $80M – $100M ad campaign for the launch which is to occur in June.

Who knows what they’re USP is, currently Live Search isn’t particularly attractive to me personally, in that I mean, they’ve not convinced me to change my home page from google to live search.

Let’s wait and see what they do with Bing.

Please see my followup post here: Microsoft Bing – Image Search

How do you hide uTorrent? [ANSWERED]

I’ve been wondering for a while now, how to hide uTorrent from the system tray, it seems it’s fairly simple, but google’s results are completely unhelpful and most of the first page leads to forums that go off-topic, or yahoo answers which result mainly in “you cant.”.

Truth is, you can, and it’s extremely easy!

Continue reading “How do you hide uTorrent? [ANSWERED]”