Skip to content

Instantly share code, notes, and snippets.

@fparaggio
fparaggio / batch-import.py
Created October 31, 2012 04:38 — forked from ajcronk/batch-import.py
Python CSV batch import example
import dateutil.parser
import optparse
from Queue import Queue
import tempodb
from threading import Thread
class Worker(Thread):
"""Thread executing tasks from a given tasks queue"""
def __init__(self, tasks):
Thread.__init__(self)
@fparaggio
fparaggio / rails.history.js
Created December 16, 2011 13:47 — forked from nragaz/rails.history.js
Add callbacks to remote links in Rails to manage browser history using pageState and replaceState
function historySupport() {
return !!(window.history && window.history.pushState !== undefined);
}
function pushPageState(state, title, href) {
if (historySupport()) {
history.pushState(state, title, href);
}
}