Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 "";
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 / gist:2850745
Created June 1, 2012 09:33 — forked from zythum/gist:2848881
google收录的敏感词
@shellexy
shellexy / picplz_backup.py
Created June 3, 2012 02:16
备份 picplz 的相片及其标题和评论们
文件迁移到 https://bitbucket.org/shellexy/picplz_backup/raw/tip/picplz_backup.py
@shellexy
shellexy / fanfou.shellex.info.conf
Created June 6, 2012 14:57
nginx 反向代理推特官网移动版给 Chrome Lite/Mobile Safari 使用
# /etc/nginx/sites-available/fanfou.shellex.info
# 这儿假设的域名是 fanfou.shellex.info
# 请替换为实际的域名
server {
resolver 8.8.8.8;
listen 443;
server_name fanfou.shellex.info;
ssl on;
@shellexy
shellexy / localdb.js
Created June 8, 2012 09:25
之前自用的 javascript localStorage 封装
//给添加 get、set、keys、values、items、update 方法:
window.localStorage.__proto__.get = function(key, defaultvalue) {
var txt = window.localStorage.getItem(key);
if (txt == null) {
return defaultvalue;
}
try{
return JSON.parse(txt);
} catch(e){
return txt;
@shellexy
shellexy / bookmarklet 导航栏.js
Created April 10, 2013 09:31
给网页添加章节导航栏
javascript: (function() {
NodeList.prototype.forEach = Array.prototype.forEach;
var navId = 'shellexy_html5nav_bar';
if (nav = document.getElementById(navId)) {
document.body.style.marginLeft = document.body.getAttribute('marginLeft');
return nav.parentElement.removeChild(nav);
}
if (!document.styleSheets.length) {
document.body.appendChild(document.createElement('style'));
}