Skip to content

Instantly share code, notes, and snippets.

View LyonUp's full-sized avatar
🎯
Focusing

Hang Li LyonUp

🎯
Focusing
View GitHub Profile
@LyonUp
LyonUp / PrototypeCreate.js
Created February 15, 2017 01:15
创建一个使用原对象作为其原型的新对象
if (typeof Object.beget !== 'function') {
Object.create = function (o) {
var F = function () {};
F.prototype = o;
return new F();
};
}
var another_stooge = Object.create(stooge);
@LyonUp
LyonUp / hosts
Created August 30, 2016 12:33
Last updated: 2016-08-23
# Copyright (c) 2014-2016, racaljk.
# https://github.com/racaljk/hosts
# Last updated: 2016-08-23
# This work is licensed under a CC BY-NC-SA 4.0 International License.
# https://creativecommons.org/licenses/by-nc-sa/4.0/
# Localhost (DO NOT REMOVE)
127.0.0.1 localhost
255.255.255.255 broadcasthost
@LyonUp
LyonUp / booksTop250.py
Last active May 14, 2016 14:53
Web crawler
import requests
from bs4 import BeautifulSoup
import codecs
DOWNLOAD_URL = 'http://book.douban.com/top250/'
def download_page(url):
data = requests.get(url).content
return data