Skip to content

Instantly share code, notes, and snippets.

View celiomarcos's full-sized avatar
:shipit:

Celio Marcos celiomarcos

:shipit:
View GitHub Profile
@chandlerprall
chandlerprall / threaded_download.py
Created June 9, 2011 17:41
Small Python multi-threaded file downloader
import urllib2
import threading
from Queue import Queue
import sys, os, re
class ThreadedDownload(object):
REGEX = {
'hostname_strip':re.compile('.*\..*?/', re.I)
}
@brentd
brentd / gist:349955
Created March 31, 2010 04:56
delay jQuery's trigger() to prevent queueing
// Like jQuery's trigger(), only the firing of the event can be delayed by the
// specified duration (in milliseconds). The timer is reset on consecutive
// triggers with the same event name, so only the most recent event will be
// triggered when the duration ends. Useful if you need to prevent events from
// queueing up.
//
// $('#foo').bind('myEventName', function() {alert('hai')});
// ...
// $('#foo').delayedTrigger(1000, 'myEventName', 'event1');
// $('#foo').delayedTrigger(1000, 'myEventName', 'event2');