Mensch font, Source Code Pro, Webkit, Chrome, Firefox, Kaleidoscope, iTerm, Sublime Text, Sequel Pro, Codekit,
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
- 下载整站 | |
> wget -r -p -np -k http://xxoo.com | |
注释: -r 递归, -p 下载网页关联的其他资源,-np 不搜索上层目录, -k 绝对链接转为相对链接 | |
其他参数: | |
◆-b:后台下载,Wget默认的是把文件下载到当前目录。 | |
◆-O:将文件下载到指定的目录中。 | |
◆-P:保存文件之前先创建指定名称的目录。 | |
◆-t:尝试连接次数,当Wget无法与服务器建立连接时,尝试连接多少次。 | |
◆-c:断点续传,如果下载中断,那么连接恢复时会从上次断点开始下载。 |
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
#http://stackoverflow.com/questions/5031711/python-cleanest-way-to-override-init-where-an-optional-kwarg-must-be-used | |
def __init__(self, *args, **kwargs): | |
user = kwargs.pop('user', None) | |
super(BaseCheckoutForm, self).__init__(*args, **kwargs) | |
if user is not None: | |
self.prefill_from_user(user) |
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
Tutorial for compiling the Compass.app (http://compass.handlino.com/) | |
===================================================================== | |
Java installed? | |
java -version | |
Load jRuby (for example JRuby 1.6.5.1 Binary .zip) | |
http://jruby.org/download | |
Unzip jRuby to `/usr/local/` |
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
# -*- coding: utf-8 -*- | |
# 2.如遇到 UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-25: ordinal not in range(128) | |
# 增加如下3行 | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
from pyquery import PyQuery as pq |
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
# -*- coding:utf-8 -*- | |
import reuqests | |
def douban_api(subject_id): | |
# subject_id = 5308265 | |
r = requests.get('http://api.douban.com/v2/movie/%d', subject_id) | |
#r = requests.get('http://api.douban.com/v2/movie/5308265') | |
d = r.json() |
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
# -*- coding: utf-8 -*- | |
import textwrap | |
msg = """ | |
《诗经》中最早的作品大约成于西周初期,根据《尚書》上所说,《豳风·鸱鸮》为周公旦所作。2008年入藏清华大学的一批战国竹简(简称清华简)中的《耆夜》篇中,叙述武王等在战胜黎国后庆功饮酒,其间周公旦即席所作的诗《蟋蟀》,内容与现存《诗经·唐风》中的《蟋蟀》一篇有密切关系[4][5]。最晚的作品成于春秋时期中叶《诗经》中最早的作品大约成于西周初期,根据《尚書》上所说,《豳风·鸱鸮》为周公旦所作。2008年入藏清华大学的一批战国竹简(简称清华简)中的《耆夜》篇中,叙述武王等在战胜黎国后庆功饮酒,其间周公旦即席所作的诗《蟋蟀》,内容与现存《诗经·唐风》中的《蟋蟀》一篇有密切关系[4][5]。The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren’t special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-and preferably only one - obvious way to do it. Although that way may not be obvious at first unless you’re Dutch. Now is better than never. Although never is often better than *right* now. If the imp |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var list = { |
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
// 新增當地時區的時間物件 | |
function DateTimezone(offset) { | |
// 建立現在時間的物件 | |
d = new Date(); | |
// 取得 UTC time | |
utc = d.getTime() + (d.getTimezoneOffset() * 60000); | |
// 新增不同時區的日期資料 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer