This file contains hidden or 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
@echo off | |
npm --registry=https://registry.npm.taobao.org --cache=%HOME%/AppData/Roaming/npm-cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=%HOME%/.cnpmrc %* |
This file contains hidden or 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
// Step 1: open the switchproxy's option page | |
// Step 2: click the "auto switch" on the left bar | |
// Step 3: click the edit button | |
// Step 4: open the developer tools | |
// Step 5: input the code below | |
var source = $('textarea[ng-model="source.code"]')[0].value | |
var surgeRules = source.replace(/\*\.(.*?)\s+\+proxy/g,"DOMAIN-SUFFIX,$1,Proxy") | |
copy(surgeRules) | |
// Step 6: replace the original rules with surgeRules(Ctrl+V) | |
// Step 7: upload to the iCloud (Surge) |
This file contains hidden or 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
# weixnpy_uwsgi.ini file | |
[uwsgi] | |
# Django-related settings | |
# the base directory (full path) | |
chdir = /home/www/icslg/wx/weixnpy/ | |
# Django's wsgi file | |
module = weixnpy.wsgi:application | |
env = DJANGO_SETTINGS_MODULE = weixnpy.settings | |
# the virtualenv (full path) |
This file contains hidden or 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
#!/bin/bash | |
# 使用GBK Profile | |
echo -e "\033]50;SetProfile=GBK\a" | |
# 环境编码切换为GBK | |
export LANG=zh_CN.GBK | |
export LC_ALL=zh_CN.GBK | |
# 更改当前 iTerm2 tab title | |
echo -ne "\033]0;"$@"\007" | |
$@ | |
echo -ne "\033]0;"${PWD/#$HOME/~}"\007" |
This file contains hidden or 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://www.cppblog.com/snailcong/archive/2009/03/16/76705.html | |
#include <iostream> | |
using namespace std; | |
struct st1 { | |
char a; | |
int b; | |
short c; | |
}; |
This file contains hidden or 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
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/1868955 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO |
This file contains hidden or 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
#均衡负载 | |
upstream google { | |
ip_hash; | |
server 216.239.32.39:443 max_fails=1 weight=2; | |
server 173.194.120.88:443 max_fails=1 weight=2; | |
server 74.125.21.98:443 max_fails=1; | |
server 74.125.21.40:443 max_fails=1; | |
server 74.125.21.47:443 max_fails=2; | |
# server 74.125.21.41:443 max_fails=3; |
This file contains hidden or 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
import os | |
import tempfile | |
import shutil | |
from contextlib import contextmanager | |
@contextmanager | |
def tempinput(file_): | |
temp = tempfile.NamedTemporaryFile(delete=False) | |
shutil.copyfileobj(file_, temp) | |
temp.close() |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import re | |
import urllib | |
import urllib2 | |
import cookielib | |
import time | |
import getpass | |
import threading | |
from HTMLParser import HTMLParser | |
import ConfigParser |