Skip to content

Instantly share code, notes, and snippets.

View lxneng's full-sized avatar
🎯
Focusing

Eric Luo lxneng

🎯
Focusing
View GitHub Profile
$ brew install postgresql
==> Downloading http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.2/postgresql-8.4.2.tar.bz2
######################################################################## 100.0%
==> ./configure --enable-thread-safety --with-bonjour --with-python --with-perl --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxsl
==> make install
==> Caveats
If this is your first install, create a database with:
initdb /usr/local/var/postgres
Automatically load on login with:
@lxneng
lxneng / uri.py
Created February 23, 2010 05:50 — forked from dsc/uri.py
#!/usr/bin/env python
# encoding: utf-8
""" A simple URI Encoding/Decoding commandline tool.
"""
__author__ = 'David Schoonover <[email protected]>'
__date__ = '2009-06-05'
__version__ = (0, 0, 1)
import sys, select, urllib
@lxneng
lxneng / snippet.txt
Created February 21, 2010 15:23 — forked from qingfeng/snippet.txt
#!/usr/bin/env python
# encoding: utf-8
from twill import *
import urllib2,re
USERNAME = 'YOUR USERNAME'
PASSWORD = 'YOUR PASSWORD'
BLOG_LIST = [
@lxneng
lxneng / sp.py
Created February 21, 2010 15:20 — forked from qingfeng/sp.py
from scrapy import log
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.xpath.selector import HtmlXPathSelector
from scrapy.item import ScrapedItem
def safecn(i):
try:
return unichr(int(i))
except:
@lxneng
lxneng / new9.py
Created February 21, 2010 15:17 — forked from qingfeng/new9.py
#!/usr/bin/env python
# encoding: utf-8
# Author: [email protected]
from __future__ import with_statement
from optparse import OptionParser
import os
parser = OptionParser(version="new9 command v1.0 -- by [email protected]")
parser.add_option("-p", "--install",