Skip to content

Instantly share code, notes, and snippets.

View johnfink8's full-sized avatar

John Fink johnfink8

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johnfink8
johnfink8 / itemprocessor.py
Created April 9, 2012 01:48
Process a list of input using a given function using multiple parallel processes.
'''
ItemProcessor
Written by: John Fink
Takes a list of objects, and a function, and some optional arguments to
that function. Runs that function (with those optional arguments) against
each element of the input list, in parallel. Results from each function
call can be retrieved in a list of tuples (along with the input) with
@johnfink8
johnfink8 / views.py
Created March 27, 2012 01:01
Simple Django one-off view that pulls down a listing of Craigslist ads from all Craigslist domains. Ain't exactly pretty, but it works. It's not fast by web standards, but it sure beats searching manually.
import urllib2,os,cookielib
from urlparse import urlparse
from BeautifulSoup import BeautifulSoup
from django.core.cache import cache
from django.http import HttpResponse
import multiprocessing
m=multiprocessing.Manager()
links=m.list()
hosts=m.Queue()
@johnfink8
johnfink8 / LICENSE
Last active March 10, 2024 16:47
SFTP/SSH Paramiko Wrapper
MIT License
Copyright (c) 2012 John Fink
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: