ChinaDNS 的上游 DNS 分为 国内 DNS
和 可信 DNS
。
- ChinaDNS 会同时向上游的 DNS 发送请求。
- 如果
可信 DNS
先返回,则直接采用可信 DNS
的结果。 - 如果
国内 DNS
先返回,分两种情况:如果返回的结果是国内的 IP, 则采用;否则丢弃并转而采用可信 DNS
的结果。
registry=https://registry.npm.taobao.org | |
disturl=https://npm.taobao.org/dist | |
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ | |
electron_mirror=https://npm.taobao.org/mirrors/electron/ | |
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver | |
operadriver_cdnurl=https://npm.taobao.org/mirrors/operadriver | |
selenium_cdnurl=https://npm.taobao.org/mirrors/selenium | |
node_inspector_cdnurl=https://npm.taobao.org/mirrors/node-inspector | |
fsevents_binary_host_mirror=http://npm.taobao.org/mirrors/fsevents/ |
// mapping like vimum | |
map('u', 'e'); | |
mapkey('p', "Open the clipboard's URL in the current tab", function() { | |
Front.getContentFromClipboard(function(response) { | |
window.location.href = response.data; | |
}); | |
}); | |
map('P', 'cc'); | |
map('gi', 'i'); | |
map('F', 'af'); |
#!/usr/bin/env python3 | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
# dictionary with pre-counted bins | |
test = {1:1,2:1,3:1,4:2,5:3,6:5,7:4,8:2,9:1,10:1} | |
# with matplotlib | |
plt.hist(list(test.keys()), weights=list(test.values())) |
# lifted cool stuff from: | |
# https://github.com/fish-shell/fish-shell/blob/master/share/functions/fish_prompt.fish | |
# https://github.com/fish-shell/fish-shell/blob/master/share/tools/web_config/sample_prompts/robbyrussell.fish | |
function fish_prompt | |
# define git functions if not already defined | |
if not set -q -g __fish_git_functions_defined | |
set -g __fish_git_functions_defined | |
function _git_branch_name |
# good discussion here: http://stackoverflow.com/questions/4308168/sigmoidal-regression-with-scipy-numpy-python-etc | |
# curve_fit() example from here: http://permalink.gmane.org/gmane.comp.python.scientific.user/26238 | |
# other sigmoid functions here: http://en.wikipedia.org/wiki/Sigmoid_function | |
import numpy as np | |
import pylab | |
from scipy.optimize import curve_fit | |
def sigmoid(x, x0, k): | |
y = 1 / (1 + np.exp(-k*(x-x0))) |
from matplotlib.colors import hex2color | |
# color schemes Courtesy of the excellent mbostock's D3.js project | |
d3_10 = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'] | |
d3_20 = ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#8c564b', '#c49c94', '#e377c2', '#f7b6d2', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5'] | |
d3_20b = ['#393b79', '#5254a3', '#6b6ecf', '#9c9ede', '#637939', '#8ca252', '#b5cf6b', '#cedb9c', '#8c6d31', '#bd9e39', '#e7ba52', '#e7cb94', '#843c39', '#ad494a', '#d6616b', '#e7969c', '#7b4173', '#a55194', '#ce6dbd', '#de9ed6'] | |
d3_20c = ['#3182bd', '#6baed6', '#9ecae1', '#c6dbef', '#e6550d', '#fd8d3c', '#fdae6b', '#fdd0a2', '#31a354', '#74c476', '#a1d99b', '#c7e9c0', '#756bb1', '#9e9ac8', '#bcbddc', '#dadaeb', '#636363', '#969696', '#bdbdbd', '#d9d9d9'] |