Tuesday, October 2nd, 2007

PasteMonkey.org: Yet another Pastebin project

Category: Ajax, JavaScript, jQuery

Tane Piper recently announced the beta launch of his new project, Paste Monkey. As Tane so aptly refers to it, Paste Monkey is “Yet Another Pastebin Project” which leverages a host of technologies for easing the aggregation of code snippets, including:

Tane makes extensive use of jQuery Live Query plugin, which provides functionality similar to Behaviour, to dynamically bind events to specific elements throughout the application.

…the site has a heavy use of Live Query – this brilliant library for jQuery is the number one tool for developing AJAX sites. An example of one of my Live Query functions is below:

1. $pastemonkey(‘a’, ‘.paging’).livequery(function(){
2. $pastemonkey(this).bind(‘click.paging’, function(){
3. $pastemonkey(‘#content’).load($pastemonkey(this).attr(‘href’));
4. return false;
5. });
6. }, function(){
7. $pastemonkey(this).unbind(‘click.paging’);
8. });

This code is used for the pagination controls when viewing existing posts. It allows the page to be reloaded via AJAX, and still be fully working. It also unbinds the event as well when unloaded to reduce memory leaks.

The site’s source code is also available and can be found at the project’s Google Code repo. You can go past some scripts here.

Posted by Rey Bango at 3:30 am
9 Comments

+++--
3.2 rating from 31 votes

9 Comments »

Comments feed TrackBack URI

Its soo slooow

Comment by Pete — October 2, 2007

I must be Web 2.0 dense, but…what purpose does this serve?

Comment by Brian — October 2, 2007

@Pete
Yea, it is a little slow at the moment – I’m currently trying to debug a lot of the code on the JavaScript side using Firebug and Venkman, but feel free to turn JS off and see that the site works fully without it too.

@Brian
It’s a collaborative pastebin, it means rather than posting lengthy reams of code in IRC, you can paste it here instead and just use the link in IRC.

Comment by Tane Piper — October 2, 2007

How did ever end up on Ajaxian? This is a half-assed paste bin. The site doesn’t even work properly, and why would I ever want to enter a captcha when entering code?

Comment by Andrew — October 2, 2007

@Andrew

Rather than just saying ‘site doesn’t work properly’, maybe filing a bug report might help better? Is your JavaScript freezing? are you getting white screens? (I am experiencing load issues on my server, the memory keeps crapping out – I suppose I should maybe plump for a 512mb VPS instead of 256 to run my LAMP server).

Comment by Tane Piper — October 2, 2007

Thank you Tane for sharing your work. The world needs another PasteBin? Sure :) Check Ext’s one: http://ido.nl.eu.org/extpaste/ (by trbs, prealphafarfrombeta initial release).

Comment by Miguel Benevides — October 2, 2007

@Miguel
Thanks, the Ext example looks good. I’m happy to claim this project is Yet Another pastebin – I wasn’t happy with any implementations out there for PHP, so I decided to write it really for myself, but happy to share. It’s not the most elegant or robust, but since I am on the hunt for a new job I am including it in my resume.

Comment by Tane Piper — October 2, 2007

@Pete
I’ve upgraded my server today, and installed Memcache – hopfully you should see major improvement now.

Comment by Tane Piper — October 2, 2007

Another pastebin: http://www.posteet.com

Comment by vrossign — January 24, 2008

Leave a comment

You must be logged in to post a comment.