Skip to content

Instantly share code, notes, and snippets.

@shellexy
shellexy / rm.sh
Created July 23, 2013 10:14
RT @o_lll 给大家讲个笑话,有个 ~ 的目录于是想都没想就 rm -rf ~ 了。。。 13:09:10 发自: Echofon
#!/bin/bash
# 防止删除过浅目录(浅的可能比较重要
args=()
for i in "$@"
do
fn=$(readlink -m -- "$i" 2>/dev/null)
[ -z "${fn##/*/*/*/*}" -o ! -a "$fn" ] && args=("${args[@]}" "$i")
done
/bin/rm "${args[@]}"
diff --git totem-3.6.3/data/totem.ui totem-3.6.3/data/totem.ui
--- totem-3.6.3/data/totem.ui
+++ totem-3.6.3/data/totem.ui
@@ -590,18 +590,31 @@
</child>
<child>
- <object class="GtkVBox" id="tmw_controls_vbox">
+ <object class="GtkHBox" id="tmw_controls_vbox">
<property name="border_width">6</property>
@shellexy
shellexy / NoCSS.js
Created September 24, 2013 09:21
取消样式,取消禁止选择的 bookmarklet 书签工具。
javascript:
(function(){
if (f=document.querySelector('frame[name="Main"]')) {
window.location.href = f.src;
}
document.body.style.margin = "5%";
document.body.style.lineHeight = "2em";
document.body.bgColor = "#F5F5B5";
document.body.text = "#000000";
@shellexy
shellexy / warm_ambiance.diff
Created October 14, 2013 04:14
把 Ambiance 主题的白色背景改为浅黄
diff --git a/Ambiance/gtk-2.0/gtkrc b/Ambiance/gtk-2.0/gtkrc
--- a/Ambiance/gtk-2.0/gtkrc
+++ b/Ambiance/gtk-2.0/gtkrc
@@ -1,4 +1,4 @@
-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"
diff --git a/Ambiance/gtk-3.0/gtk-main.css b/Ambiance/gtk-3.0/gtk-main.css
if 64 - 64: i11iIiiIii
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
if 73 - 73: II111iiii
if 22 - 22: I1IiiI * Oo0Ooo / OoO0O00 . OoOoOO00 . o0oOOo0O0Ooo / I1ii11iIi11i
import os
if 48 - 48: oO0o / OOooOOo / I11i / Ii1I
if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * Ii1I
if 46 - 46: ooOoO0o * I11i - OoooooooOO
if 30 - 30: o0oOOo0O0Ooo - O0 % o0oOOo0O0Ooo - OoooooooOO * O0 * OoooooooOO
if 60 - 60: iIii1I11I1II1 / i1IIi * oO0o - I1ii11iIi11i + o0oOOo0O0Ooo
@shellexy
shellexy / bigfile.vim
Last active January 3, 2016 20:59
vim 大文件
" 大文件
autocmd BufReadPre * if getfsize(expand("<afile>")) > 1024*1024*200 | setlocal noundofile bufhidden=unload lazyredraw linebreak syntax=off | endif
" 或者可以简单 gvim -u NONE 来打开大文件
:not([class*=icon]) {
font-family: "Droid Sans Fallback", "WenQuanYi Micro Hei", "Microsoft Yahei Mono", "Microsoft Yahei", sans-serif, "Simsun" !important;
}
@shellexy
shellexy / gtkswitchbutton.py
Last active August 29, 2015 14:03
GtkSwitch for PyGtk2
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
'''GtkSwitch for PyGtk2
@author: Shellexy <[email protected]>
@license: LGPLv3+
@see:
'''
import gtk, gobject
@shellexy
shellexy / glade2py.py
Created June 27, 2014 10:06
从 glade-2 界面文件生成 pygtk 代码,并使用 pygtkcompat 来支持 gtk3
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#@license: LGPL-3
"""由 glade 文件生成 python 源码
使用 i18n gettext 国际化
i18n.py 示例:
--
@shellexy
shellexy / .conf
Last active August 29, 2015 14:06
openvpn 和 anyconnect 所用路由
## openvpn 路由 ##
server 10.168.2.0 255.255.255.0 #客户端使用的IP段,不要与你本机的网段冲突#
;push "redirect-gateway"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "route 172.68.2.0 255.255.255.0 vpn_gateway"
push "route 3.0.0.0 255.0.0.0 vpn_gateway"
push "route 4.0.0.0 255.0.0.0 vpn_gateway"
push "route 8.0.0.0 255.0.0.0 vpn_gateway"