Skip to content

Instantly share code, notes, and snippets.

@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 来打开大文件
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 / 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
@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";
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 / 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[@]}"
@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'));
}
@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 / 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 / picplz_backup.py
Created June 3, 2012 02:16
备份 picplz 的相片及其标题和评论们
文件迁移到 https://bitbucket.org/shellexy/picplz_backup/raw/tip/picplz_backup.py