Skip to content

Instantly share code, notes, and snippets.

@handloomweaver
handloomweaver / autocomplete.py
Created December 7, 2011 14:00 — forked from jedp/autocomplete.py
autocomplete.py - redis autocompleter
"""
A redis autocomplete example for multi-word phrases.
Based on:
Ruby original: http://gist.github.com/574044
Python original: https://gist.github.com/577852
See options below for usage
Requires http://github.com/andymccurdy/redis-py/
@handloomweaver
handloomweaver / top3stories.js
Created October 27, 2011 15:14 — forked from DTrejo/top3stories.js
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@handloomweaver
handloomweaver / crawler.py
Created October 17, 2011 04:04 — forked from jmoiron/crawler.py
Simple gevent/httplib2 web crawler.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple async crawler/callback queue based on gevent."""
import traceback
import logging
import httplib2
import gevent
window.addEventListener "DOMContentLoaded", ->
body = $ "body"
canvas = $ "#canvas"
chalkboard = $ "#chalkboard"
close = $ "#close"
ledge = $ "#ledge"
lightswitch = $ "#lightswitch"
output = $ "#output"
shade = $ "#shade"
share = $ "#share"
@handloomweaver
handloomweaver / oursql-install
Created August 1, 2011 10:02
Installing oursql via pip on Mac OS X
# switch to super user
sudo -i
# set up environment
export PIP_MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
export MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
# install
pip install oursql
@handloomweaver
handloomweaver / eventlet_gs_uploader.py
Created July 18, 2011 22:35 — forked from batok/eventlet_gs_uploader.py
A python script to do asynchronous upload to google storage using boto and eventlet libraries
# this program uploads to google storage using boto and eventlet all the jpg files of a selected folder
import eventlet
bcon = eventlet.import_patched("boto.gs.connection")
import glob
FOLDER = "/Users/myself/Documents/" # replace this with your chosen folder
BUCKET_NAME = "whateveryourbucketname" # replace this with your bucket name
def upload(myfile):
c = bcon.GSConnection()
#!/usr/bin/env bash
# Build CouchDB 1.0.1 from source using build-couchdb. All needed dependencies
# are also build from source and form a self-contained installation. Specifiy
# COUCHDB_PREFIX to the location where you would like to have everything
# installed to.
# When everything is done, the init.d-script and default settings for CouchDB
# are linked to the right places, the bind address is set to 0.0.0.0 and CouchDB
# will be started, so you can relax!
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.OTransition !== undefined || thisStyle.transition !== undefined;
return support;
})();