Skip to content

Instantly share code, notes, and snippets.

View greatghoul's full-sized avatar
🏠
Working from home

greatghoul greatghoul

🏠
Working from home
View GitHub Profile
html, body, p, form, div, table, textarea, input, span, select {
font-size: 24px;
line-height: 1.5em;
}
html {
background-color: #2A2727;
}
body {
@greatghoul
greatghoul / smarthosts.py
Created December 27, 2011 14:39
smarthosts.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import urllib
import os
from shutil import copyfile
from datetime import datetime
HOST_START_FLAG = '#Hosts 开始'
@greatghoul
greatghoul / logging.cfg
Created May 11, 2012 10:03
logging.cfg
###############################################
[loggers]
keys=root
[logger_root]
level=INFO
handlers=console,file
###############################################
[handlers]
keys=console,file
[handler_console]
@greatghoul
greatghoul / autoframeheihgt.js
Created May 29, 2012 03:17
iframe高度自适应
var timer = null;
function autoFrameHeight() {
timer && clearTimeout(timer);
var frame = document.getElementById('win');
var currHeight = 0;
try {
if (frame.contentDocument && frame.contentDocument.body.offsetHeight) {
frame.height = frame.contentDocument.body.offsetHeight;
} else if (frame.document && frameid.document.body.scrollHeight) {
frame.height = frame.document.body.scrollHeight;
@greatghoul
greatghoul / fmt.js
Created July 10, 2012 01:22
Javascript Simple Templating Method
// 格式化字符串
//
// 用法:
//
// var s1 = '%{1} and %{2}!';
// console.log('source: ' + s1);
// console.log('target: ' + fmt(s1, 'ask', 'learn'));
//
// var s2 = "%{name} is %{age} years old, his son's name is %{sons[0].name}";
// console.log('source: ' + s2);
@greatghoul
greatghoul / adblock-main.txt
Created August 15, 2012 06:07
AdBlock Filters
[Adblock Plus 1.1]
! Title: My AdBlock Filters
www.86bts.com##IFRAME[id="__KR_LM_Frame"][name="__KR_LM_Frame"]
www.86bts.com##IFRAME[id="xcy_frame_*"][name="xcy_frame_*"]
www.86bts.com##IFRAME[id="cproIframe*"]
@greatghoul
greatghoul / list.txt
Created August 31, 2012 12:54
中国奥运榜样刷票
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
@greatghoul
greatghoul / GoogleReader.py
Created September 13, 2012 05:12 — forked from 872409/GoogleReader.py
GoogleReader 订阅XX天无更新退订管理
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: dawn
'''
import urllib, urllib2, cookielib, json
from datetime import datetime
EMAIL = 'xxx@gmail.com'
@greatghoul
greatghoul / 265g_pics.py
Created September 26, 2012 17:22
265g.com 美图下载
#-*- coding: utf-8 -*-
import urllib, re, os, argparse
RE_NEXT_URL = ur'<a href=\"(?!javascript\:)([^\"]*?)">下一页<\/a>'
RE_PICTURE = ur'<p\s+(?:align=\"center\")>\s*<img.*?src=\"(.*?)\".*?\/?>'
RE_ARCTITLE = ur'var arctitle=\'(.*?)\';'
def get_html(url):
try:
return urllib.urlopen(url).read().decode('gbk')
@greatghoul
greatghoul / gmail-gist.xml
Created September 28, 2012 15:13
Gist Gmail Gadget
<?xml version="1.0" encoding="UTF-8" ?>
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<!-- Support info to show in the marketplace & control panel -->
<Support>
<!-- URL for application setup as an optional redirect during the install -->
<Link rel="setup" href="http://_example.com_/google/setup.php?domain=${DOMAIN_NAME}" />
<!-- URL for application configuration, accessed from the app settings
page in the control panel -->