Python and MongoDB: A Quick Reference to PyMongo

2013年5月23日 11:09

Installing the MongoDB Library

$ easy_install pymongo
or
# sudo easy_install pymongo

Importing the MongoDB Library

from pymongo import MongoClient

Connecting to MongoDB

client = MongoClient("192.168.1.1", 27017)

Selecting a Database

client = MongoClient("192.168.1.1", 27017)
db_instance = client["database_name"]

继续阅读 »

博客皮肤换了~哈哈

2013年4月08日 22:26

把博客新整了下

旧版:

新版:

继续阅读 »

The 100 Words That Will Get You Hired Anywhere

2013年3月07日 11:08

You should hire me because I will work harder than anyone else you’re going to talk to. On Sunday evenings I process all of my email and write out my goals for the week. I show up an hour before everyone else each morning to make the coffee and get my most important task for the day done. I spend as many lunches and breakfasts as possible with prospective or current clients. And I take the local train instead of the express so I can write thank you cards or notes to clients. That’s why you should hire me.

继续阅读 »

Rails Partial

2013年3月06日 22:33

Collection:

<%= render :partial => "common/post", :collection => @posts %>

Partials are very useful in rendering collections. When you pass a collection to a partial via the :collection option, the partial will be inserted once for each member in the collection

Object:

<%= render :partial => "customer", :object => @new_customer %>

继续阅读 »

个人博客终于上线了

2013年3月06日 00:56

个人博客终于上线了,以后可以在这上边记一些东西了。

继续阅读 »

重启Nginx

2013年3月06日 00:49

平滑重启Nginx:sudo killall -HUP nginx

或者:

sudo fuser -k 80/tcp
sudo /etc/init.d/nginx start

继续阅读 »

ERROR: Error installing mysql2

2013年3月06日 00:42

bundle install 时,ubuntu下,mysql2 gem安装报错。

解决办法:sudo apt-get install libmysqlclient-dev

继续阅读 »