- Bijou 150 x 10 pixels icons : http://bijou.im/
- http://thenounproject.com/
- 50 amazing free icons sets : http://webdesignledger.com/freebies/50-amazing-free-icon-sets
- Smashing Mag : 35 (Really) Incredible Free Icon Sets : http://www.smashingmagazine.com/2008/03/06/35-really-incredible-free-icon-sets/
- 30 free icons packs from the Dribble community : http://line25.com/articles/30-free-icon-packs-from-the-dribbble-community
- 32 elegant and minimalist icon packs : http://psd.fanextra.com/articles/32-elegant-and-minimalist-icon-packs/
- POI icons : http://mapbox.com/maki/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scrapy import log | |
from scrapy.item import Item | |
from scrapy.http import Request | |
from scrapy.contrib.spiders import XMLFeedSpider | |
def NextURL(): | |
""" | |
Generate a list of URLs to crawl. You can query a database or come up with some other means | |
Note that if you generate URLs to crawl from a scraped URL then you're better of using a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<Data> | |
<Series> | |
<id>83462</id> | |
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors> | |
<Airs_DayOfWeek>Monday</Airs_DayOfWeek> | |
<Airs_Time>10:00 PM</Airs_Time> | |
<ContentRating>TV-PG</ContentRating> | |
<FirstAired>2009-03-09</FirstAired> | |
<Genre>|Drama|</Genre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grequests | |
from collections import deque | |
class RequestQueue(object): | |
""" | |
This is a lame imitation of a Typhoeus Hydra using GRequests. | |
The main thing this allows is building up a queue of requests and then | |
executing them, and potentially adding requests to the queue in a callback | |
so that you can build requests that depend on other requests more naturally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.x has an ambiguous except syntax, Python 3.x is stricter so the | |
# following examples help to identify the right way to handle Py2/3 compatible | |
# exceptions | |
# Background: http://www.python.org/dev/peps/pep-3110/ | |
# Note that 'as' and ',' are both accepted in Python 2.x but only 'as' in Python 3.x: | |
# http://docs.python.org/reference/compound_stmts.html#try | |
# There are longer notes on re-raising, stack traces and tracebacks here: | |
# http://www.doughellmann.com/articles/how-tos/python-exception-handling/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE these are code snippets | |
import datetime | |
import time | |
from dateutil import parser as dt_parser # python-dateutil package | |
# make a date 30 days ago, conver to truncated string in custom format, convert | |
# back to datetime | |
filter_from = datetime.datetime.now() - datetime.timedelta(days=30) | |
print filter_from, type(filter_from) | |
filter_from_str = time.strftime("%Y-%m-%dT%H:%M", filter_from.timetuple()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PIL import Image | |
def extractFrames(inGif, outFolder): | |
frame = Image.open(inGif) | |
nframes = 0 | |
while frame: | |
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
nframes += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from scrapy.selector import HtmlXPathSelector | |
from myspider.items import CraigslistSampleItem | |
class MySpider(CrawlSpider): | |
name = "craigs" | |
allowed_domains = ["sfbay.craigslist.org"] | |
start_urls = ["http://sfbay.craigslist.org/"] |