使用路由表实现分流
proxychains 最多只支持 64 条路由规则
因此使用 tsocks 而不是 proxychains
由于 brew tap adamv/alt 已不能使用,需要手动创建 Formula
创建 /usr/local/Library/Formula/tsocks.rb 内容如下
require 'formula'
使用路由表实现分流
proxychains 最多只支持 64 条路由规则
因此使用 tsocks 而不是 proxychains
由于 brew tap adamv/alt 已不能使用,需要手动创建 Formula
创建 /usr/local/Library/Formula/tsocks.rb 内容如下
require 'formula'
| // Variables | |
| // –––––––––––––––––––––––––––––––––––––––––––––––– | |
| $base-font-size = 16px | |
| $global-border-radius = 4px | |
| // | |
| // REM Calculator | |
| // | |
| // Calculates and returns the REM value based on PX input |
| let M = transformer#middle() | |
| let S = transformer#source() | |
| call transformer#cmd('Html2jade') | |
| \.src(S.smart()) | |
| \.stream( | |
| \ M.pipe('html2jade - --donotencode --bodyless'), | |
| \ M.smart() | |
| \) |
| 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() { |
| /* | |
| 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. | |
| */ | |
| * { |
| if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { | |
| // some code.. | |
| } |
| { | |
| "libs": [ | |
| "browser", | |
| "underscore", | |
| "jquery" | |
| ], | |
| "plugins": { | |
| "node": {} | |
| } | |
| } |
| // this is the background code... | |
| // listen for our browerAction to be clicked | |
| chrome.browserAction.onClicked.addListener(function (tab) { | |
| // for the current tab, inject the "inject.js" file & execute it | |
| chrome.tabs.executeScript(tab.ib, { | |
| file: 'inject.js' | |
| }); | |
| }); |
| function convertTimestamp(timestamp) { | |
| var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
| yyyy = d.getFullYear(), | |
| mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
| dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
| hh = d.getHours(), | |
| h = hh, | |
| min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
| ampm = 'AM', | |
| time; |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]