使用路由表实现分流
proxychains 最多只支持 64 条路由规则
因此使用 tsocks 而不是 proxychains
由于 brew tap adamv/alt 已不能使用,需要手动创建 Formula
创建 /usr/local/Library/Formula/tsocks.rb 内容如下
require 'formula'
| /* | |
| This is for demonstration purposes. Ideally, you should never use the star selector. | |
| I recommend that you use this early on in your development, and then once you've established | |
| your HTML element palette, go back and replace * with a comma-separated list of your | |
| tag names. Additionally, the !important shouldn't have to be used, but I'm leaving it here | |
| because some enterprising goons will probably copy and paste this directly into their project - | |
| the !important will ensure these settings override other attempts that were either never | |
| deleted or are part of an installed CSS file the user is unaware of. | |
| */ | |
| * { |
| function pad(n) { | |
| return n < 10 ? '0' + n.toString(10) : n.toString(10); | |
| } | |
| var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', | |
| 'Oct', 'Nov', 'Dec']; | |
| // 26 Feb 16:19:34 | |
| function timestamp() { |
| let M = transformer#middle() | |
| let S = transformer#source() | |
| call transformer#cmd('Html2jade') | |
| \.src(S.smart()) | |
| \.stream( | |
| \ M.pipe('html2jade - --donotencode --bodyless'), | |
| \ M.smart() | |
| \) |
| // Variables | |
| // –––––––––––––––––––––––––––––––––––––––––––––––– | |
| $base-font-size = 16px | |
| $global-border-radius = 4px | |
| // | |
| // REM Calculator | |
| // | |
| // Calculates and returns the REM value based on PX input |
使用路由表实现分流
proxychains 最多只支持 64 条路由规则
因此使用 tsocks 而不是 proxychains
由于 brew tap adamv/alt 已不能使用,需要手动创建 Formula
创建 /usr/local/Library/Formula/tsocks.rb 内容如下
require 'formula'
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
| var a = ["sdfdf", "http://oooooolol"], | |
| handleNetErr = function(e) { return e }; | |
| Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr)) | |
| .then(function(sdf, invalid) { | |
| console.log(sdf, invalid) // [Response, TypeError] | |
| }) | |
| .catch(function(err) { | |
| console.log(err); | |
| }) |
| // decorate the class, composition | |
| function waitFor(prop) { | |
| return ChildComponent => class extends Component { | |
| render() { | |
| return this.props[prop] ? <ChildComponent {...this.props} /> : null | |
| } | |
| } | |
| } | |
| // decorate the class, inheritance |
| /** | |
| * @param {String} msg 错误信息 | |
| * @param {String} url 出错的文件 | |
| * @param {Long} line 出错代码的行号 | |
| * @param {Long} col 出错代码的列号 | |
| * @param {Object} error 错误的详细信息,Anything | |
| */ | |
| window.onerror = function(msg,url,line,col,error){ | |
| //没有URL不上报!上报也不知道错误 | |
| if (msg != "Script error." && !url){ |
| git remote prune origin | |
| git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin |