- 进入你的
home目录
cd ~
- 编辑
.bashrc文件
| npm set registry https://registry.npm.taobao.org # 注册模块镜像 | |
| npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
| ## 以下选择添加 | |
| npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
| npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
| npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
| npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
| npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 | |
| npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像 |
| var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth"; | |
| str.match(/\w(ox)/g); // ["fox", "box", "sox"] | |
| // match (when used with a 'g' flag) returns an Array with all matches found | |
| // if you don't use the 'g' flag then it acts the same as the 'exec' method. | |
| str.match(/\w(ox)/); // ["fox", "ox"] | |
| /\w(ox)/.exec(str); // ["fox", "ox"] |
| <html> | |
| <body> | |
| <script> | |
| // @author: ideawu | |
| // @link: http://www.ideawu.net/blog/archives/1021.html | |
| var swap_count = 0; | |
| var cmp_count = 0; | |
| // https://gist.github.com/wintercn/c30464ed3732ee839c3eeed316d73253 | |
| function wintercn_qsort(arr, start, end){ |
| var bb = require('./bb.js'); | |
| var cc = require('./cc.js'); | |
| module.exports = function(){ | |
| console.log('-------- aa ----------') | |
| }; |
| #!/bin/bash | |
| # update_gfwlist.sh | |
| # Author : VincentSit | |
| # Copyright (c) http://xuexuefeng.com | |
| # | |
| # Example usage | |
| # | |
| # ./whatever-you-name-this.sh | |
| # | |
| # Task Scheduling (Optional) |
| //## Moment.JS Holiday Plugin | |
| // | |
| //Usage: | |
| // Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned. | |
| // Otherwise, return nothing. | |
| // | |
| // Example: | |
| // `moment('12/25/2013').holiday()` will return "Christmas Day" | |
| // | |
| //Holidays: |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #!/usr/bin/env python | |
| #coding=utf-8 | |
| # | |
| # Generate a list of dnsmasq rules with ipset for gfwlist | |
| # | |
| # Copyright (C) 2014 http://www.shuyz.com | |
| # Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
| import urllib2 | |
| import re |
| var parser = function(url) { | |
| var a = document.createElement('a'); | |
| a.href = url; | |
| var search = function(search) { | |
| if(!search) return {}; | |
| var ret = {}; | |
| search = search.slice(1).split('&'); | |
| for(var i = 0, arr; i < search.length; i++) { |