Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python2
# vim: set fileencoding=utf8
import re, sys, os, random, datetime, time, json, urllib2, logging
from mutagen.id3 import ID3,TRCK,TIT2,TALB,TPE1,APIC
from HTMLParser import HTMLParser
parser = HTMLParser()
s = u'\x1b[1;%dm%s\x1b[0m' # terminual color template
@holys
holys / log
Created September 3, 2013 03:59
==> Downloading http://gource.googlecode.com/files/gource-0.40.tar.gz
Already downloaded: /Library/Caches/Homebrew/gource-0.40.tar.gz
tar xf /Library/Caches/Homebrew/gource-0.40.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gource/0.40 --disable-sdltest --without-x --disable-freetypetest
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gource/0.40 --disable-sdltest --without-x --disable-freetypetest
configure: WARNING: unrecognized options: --disable-sdltest, --disable-freetypetest
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
@holys
holys / lamp.sh
Created August 19, 2013 11:19
learn shell script
#!/bin/bash -
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================
# SYSTEM REQUIRED: CentOS-5 (32bit/64bit)¡¢CentOS-6 (32bit/64bit)
# DESCRIPTION: Install LAMP in CentOS
# AUTHOR: Zhu Maohai.
# REVISION: 0.4
# website: http://www.centos.bz/lamp/
#===============================================================================
#!/usr/bin/env python
# coding: utf-8
from weibo import APIClient
from config import APP_KEY, APP_SECRET, CALLBACK_URL, ACCESS_TOKEN, EXPIRES_IN
def count_fake():
client = APIClient(app_key=APP_KEY, app_secret=APP_SECRET,
redirect_uri=CALLBACK_URL)
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
import requests
import re
url = 'http://www.douban.com/group/machome/discussion?start=%d'
topic_ptn = re.compile(r'href=\"(.+?group/topic.+?)/\"')
@holys
holys / ffmpeg.md
Last active December 19, 2015 08:39
  • generate the raw video file (gource.ppm)

这一步有点慢, 有些卡顿, 但是对后面的播放是没有影响的.

 gource --title "easylib" --hide filenames  -f -1920x1080 --camera-mode overview  --auto-skip-seconds 0.3 --highlight-all-users --elasticity 0.1 -b 000000  --disable-progress -o gource.ppm
  • make video
@holys
holys / topic_search.js
Last active April 22, 2022 19:37
勉强能用吧
// ==UserScript==
// @name douban topic search
// @namespace http://www.douban.com/update/
// @version 0.1
// @description provide a topic search entry
// @match http://www.douban.com/update/*
// @match http://www.douban.com/*
// @match http://www.douban.com/*/*/statuses
// @copyright holys
// ==/UserScript==

长度

每行不超过79个字符。

缩进

保持相同缩进方式,TAB或者空格。 采用4个空格。

缩进的基本情形:

  • 函数体
  • if语句体
60.28.250.194:82
121.15.167.231:8080
122.72.0.6:80
114.80.240.6:808
202.112.114.17:3128
221.176.14.73:80
122.113.28.52:3128
218.247.138.40:80
211.144.76.7:8181
60.190.129.52:3128