- NodeBox - a nice lib to create images of graph networks
- Python Image Library
- BeautfulSoup - HTML parser
- mechanize - automated web browsing
| # A fixed @jsonify decorator for Pylons that allows for | |
| # class implemented __json__ serializers | |
| from decorator import decorator | |
| from pylons.decorators.util import get_pylons | |
| import warnings | |
| import json | |
| import logging | |
| log = logging.getLogger(__name__) |
| 王 | |
| 江 | |
| 周 | |
| 胡 | |
| 刘 | |
| 李 | |
| 吴 | |
| 毛 | |
| 温 | |
| 习 |
| # A naive dns server with a Redis backend | |
| # Set keys in Redis you want to be authoritative for (set google.com. 127.0.0.1) | |
| # Tip: Use Redis's ttl functions to have temporary names | |
| # Currently only does A records, feel free to fix that | |
| # | |
| # Licensed under the PSF License | |
| # Thanks to: http://code.activestate.com/recipes/491264-mini-fake-dns-server/ | |
| # Author: @Kaerast <[email protected]> | |
| import socket |
| ! colours for hybrid.vim (copied from Tomorrow-Night) | |
| #define t_background #1d1f21 | |
| #define t_current_line #282a2e | |
| #define t_selection #373b41 | |
| #define t_foreground #c5c8c6 | |
| #define t_comment #969896 | |
| #define t_red #cc6666 | |
| #define t_orange #de935f | |
| #define t_yellow #f0c674 | |
| #define t_green #b5bd68 |
| from time import time | |
| def check_fit(letter_pool, word): | |
| for i in word: | |
| if i in letter_pool: | |
| letter_pool[i] -= 1 | |
| if letter_pool[i] < 0: | |
| return 0 | |
| else: | |
| return 0 | |
| return 1 |
| import simplejson as json | |
| import lxml | |
| class objectJSONEncoder(json.JSONEncoder): | |
| """A specialized JSON encoder that can handle simple lxml objectify types | |
| >>> from lxml import objectify | |
| >>> obj = objectify.fromstring("<Book><price>1.50</price><author>W. Shakespeare</author></Book>") | |
| >>> objectJSONEncoder().encode(obj) | |
| '{"price": 1.5, "author": "W. Shakespeare"}' | |
| """ |
| #!/usr/bin/env python | |
| NAMESERVERS = ['8.8.8.8'] | |
| DOMAINS = [ | |
| "webcache.googleusercontent.com", | |
| "0.docs.google.com", | |
| "0.drive.google.com", | |
| "1.docs.google.com", | |
| "1.drive.google.com", |
Based on installing Ubuntu 10.04 (lucid) and cloning the live environment (calling local environment dev.jsbin.com)
Add core packages:
sudo apt-get install libpcre3-dev build-essential libssl-dev
sudo apt-get install git-core
sudo su -
mkdir pkgs && cd pkgs
wget http://nginx.org/download/nginx-1.0.0.tar.gz