This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(u, h) { | |
h = h.toLowerCase(); | |
var DEFAULT_PROXY_PROFILE = "DirectConnection"; | |
var FIRST_RUNNING_PROXY = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080;"; | |
var i; | |
var regs = [ | |
'blogspot.', | |
'gitlab.com', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(u, h) { | |
h = h.toLowerCase(); | |
if (h === "appdownload.itunes.apple.com") { | |
return "DIRECT" | |
} | |
if (/\.?blogspot\.\w{2,3}$/.test(h) || /\.?wordpress\.com/.test(h) || /\.herokuapp\.com/.test(h) || /\.?heroku\.com/.test(h) || /\.google\.com\.\w{2}$/.test(h) || /amazonaws\.com/.test(h) || /\.google\.com$/.test(h) || /hexo\.io$/.test(h) || /gstatic\.com/.test(h) || /googleusercontent\.com/.test(h) || /(google\.\w{2}$|google\.co\.\w{2}$)/.test(h) || /rdio[^\.]*\.akamaihd\.net/.test(h) || /.*rdio.com/.test(h) || /t\.co/.test(h)) { | |
return "PROXY proxy.net:3344"; | |
} | |
a = ["tudou.com", "weibo.com", "xunlei.com", "pptv.com", "sohu.com", "taobao.com", "qq.com", "163.com", "sina.cn", "alipay.com", "youku.com"]; | |
for (i = 0; i < a.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " Don't be compatible with vi | |
let mapleader="," " change the leader to be a comma vs slash | |
command! W :w | |
cmap W! w !sudo tee % >/dev/null | |
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# aliyun apt source | |
# sudo sh -c 'echo "deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\ | |
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\ | |
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\ | |
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\ | |
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\ | |
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\ | |
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\ | |
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\ | |
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse \n\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
given a Model with: | |
category = models.CharField(max_length=32, choices=CATEGORY_CHOICES) | |
pubdate = models.DateTimeField(default=datetime.now) | |
<other fields> | |
Fetch the item from each category with the latest pubdate. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name convertCity | |
* @desc 进行 geoip 到 中文 city 的转换。源变量污染式修改。 | |
* @depend [] | |
* @param { obj } obj 用于转换的数据 | |
* @return { obj } 返回一个新的已经是中文名的 obj 。 | |
**/ | |
function convertCity(obj) { | |
var geoipcity = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --no-bin-links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html | |
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传! | |
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。 | |
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。 | |
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!! | |
步骤: | |
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z | |
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var regex = /gov.cn/ig; | |
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn"); | |
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn"); | |
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn"); | |
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn"); |