#Web scrapers on the internet
See this repo to contribute/see more: https://github.com/cassidoo/scrapers
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
from HTMLParser import HTMLParser | |
import urllib2 | |
import os | |
import re | |
re_url = re.compile(r'^(([a-zA-Z_-]+)://([^/]+))(/.*)?$') | |
def resolve_link(link, url): | |
m = re_url.match(link) |
#Web scrapers on the internet
See this repo to contribute/see more: https://github.com/cassidoo/scrapers
import os, filecmp | |
codes = {200:'success',404:'file not found',400:'error',408:'timeout'} | |
def compile(file,lang): | |
if lang == 'java': | |
class_file = file[:-4]+"class" | |
elif lang == 'c': | |
class_file = file[:-2] | |
elif lang=='cpp': |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
import sys | |
from urllib import urlencode | |
import requests | |
from urlparse import urlparse, parse_qs | |
from random import choice | |
import re | |
self_id = None # your facebook id here | |
utc_bday = None # utc timestamp of your birthday |
''' | |
Infix calculator | |
First tokenize infix expression, | |
then transform it into postfix, | |
then calculate it. | |
E.g.: | |
9 - 5 + 2 * 3 | |
=> 9 5 - 2 3 * + | |
''' | |
import re |