Skip to content

Instantly share code, notes, and snippets.

@shellexy
shellexy / gist:2850745
Created June 1, 2012 09:33 — forked from zythum/gist:2848881
google收录的敏感词
diff --git indicator-applet/src/applet-main.c indicator-applet/src/applet-main.c
--- indicator-applet/src/applet-main.c
+++ indicator-applet/src/applet-main.c
@@ -362,6 +362,21 @@ accessible_desc_update (IndicatorObject
return;
}
+static gboolean
+do_menu_reposition(gpointer menu)
+{
@shellexy
shellexy / nginx 反向代理 blog.conf
Created May 13, 2012 08:40
在 vps 用 nginx 反向代理 wordpress/blogger
# /etc/nginx/sites-available/blog.shellexy.info
server {
resolver 8.8.8.8;
listen 80;
server_name blog.shellexy.info;
#access_log off;
access_log /var/log/nginx/blog.shellexy.info.access.log;
location / {
#避免远方启用压缩导致无法替换纯文本
proxy_set_header Accept-Encoding "";
@shellexy
shellexy / Ambiance-Dark-Menus.diff
Created April 30, 2012 14:53
把 Ubuntu 12.04 默认主题改回深色菜单
diff --git a/light-themes/Ambiance/gtk-2.0/gtkrc b/light-themes/Ambiance/gtk-2.0/gtkrc
--- a/light-themes/Ambiance/gtk-2.0/gtkrc
+++ b/light-themes/Ambiance/gtk-2.0/gtkrc
@@ -1,4 +1,5 @@
-gtk-color-scheme = "base_color:#ffffff\nfg_color:#4c4c4c\ntooltip_fg_color:#ffffff\nselected_bg_color:#f07746\nselected_fg_color:#FFFFFF\ntext_color:#3C3C3C\nbg_color:#F2F1F0\ntooltip_bg_color:#000000\nlink_color:#DD4814"
+gtk-color-scheme = "base_color:#f5f5f5f5b5b5\nfg_color:#4c4c4c\ntooltip_fg_color:#ffffff\nselected_bg_color:#f07746\nselected_fg_color:#FFFFFF\ntext_color:#3C3C3C\nbg_color:#F2F1F0\ntooltip_bg_color:#000000\nlink_color:#DD4814"
+
gtk-icon-sizes = "panel-menu=22,22:gtk-button=16,16"
@shellexy
shellexy / mk-hotot-web.sh
Created April 18, 2012 13:55
生成网页版 hotot
#!/bin/bash -x
SRC=$PWD/data/
DEST=$PWD/web.hotot.org/
echo "\033[1;31;40m[i]Sync ...\033[0m"
# ignore .*.swp, .hgignore, etc
rsync -av --exclude '.*.*' --exclude '*.coffee' --exclude 'test*' $SRC $DEST
# replace conf.vars.platform, key and secret
echo "\033[1;31;40m[i] Replace platform, key and secret ...\033[0m"
@shellexy
shellexy / hotot-web.txt
Created April 17, 2012 15:48
hotot web 流 api 被错误截断
Streams callback Unexpected token r j=0 ["r.com\/download\/android\" rel=\"nofollow\"\u003ETwitter for Android\u003C\/a\u003E","contributors":null,"in_reply_to_screen_name":null,"entities":", "{"urls":[],"user_mentions":[{"indices":[3,14],"screen_name":"blacktulip","name":"blacktulip","id":11664822,"id_str":"11664822"},{"indices":[16,24],"screen_name":"cosbeta","name":"cosbeta","id":14697308,"id_str":"14697308"}],"hashtags":[]},"retweeted_status":{"text":"@cosbeta \u6c5f\u4e1c\uff0c\u95ee\u4f60\u4e2a\u4e25\u8083\u7684\u95ee\u9898\uff0c\u5f53\u5e74\u9879\u7fbd\u4e3a\u5565\u4e0d\u80af\u53bb\u4f60\u90a3\u513f\u554a\uff1f","in_reply_to_status_id_str":"191793101721976832","coordinates":null,"created_at":"Mon Apr 16 07:41:16 +0000 2012","in_reply_to_user_id_str":"14697308","favorited":false,"source":"\u003Ca href=\"http:\/\/itunes.apple.com\/us\/app\/twitter\/id409789998?mt=12\" rel=\"nofollow\"\u003ETwitter for Mac\u003C\/a\u003E","contributors":null,"in_reply_to_screen_name":"cosbeta","entities":{"urls":[],"user_
@shellexy
shellexy / dabr_expanded_t.co.diff
Created April 15, 2012 08:14
让 dabr 展开 t.co 短链
diff --git a/dabr/common/twitter.php b/dabr/common/twitter.php
--- a/dabr/common/twitter.php
+++ b/dabr/common/twitter.php
@@ -154,7 +154,7 @@ function long_url($shortURL)
function friendship_exists($user_a) {
- $request = API_URL.'friendships/show.json?target_screen_name=' . $user_a;
+ $request = API_URL.'friendships/show.json?include_entities=true&target_screen_name=' . $user_a;
$following = twitter_process($request);
@shellexy
shellexy / dabr_X-PHX.diff
Created April 15, 2012 08:14
让 dabr api 限额提高到 1000
diff --git a/dabr/common/twitter.php b/dabr/common/twitter.php
--- a/dabr/common/twitter.php
+++ b/dabr/common/twitter.php
@@ -376,6 +376,10 @@ function twitter_process($url, $post_dat
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_data);
}
+ if($post_data == false)
+ {
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-PHX: true'));
@shellexy
shellexy / CGIHTTPServer.py
Created March 28, 2012 08:38
只是测试 cgi 页面的话,不妨用自带的服务器 python -m CGIHTTPServer。这个则是多线程的修改版本
"""CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.
@shellexy
shellexy / htmldiff.py
Created March 26, 2012 06:43
html 易读格式显示 html 版本间差异
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
from difflib import SequenceMatcher
import re
from StringIO import StringIO
import cgi
import base64