Waiting for something is wasting time, especially when development, you always need to wait for compiling, wait for install dependencies…
And if you are in China, this waiting time will be much longer because of some well known reason.
Here are some changes that will save you some time in China if you are doing frontend development.
Ruby and Rails
change your gem source to China mirror, source: https://ruby-china.org/
gem source -a https://gems.ruby-china.com
change your npm source to China mirror, source , source: https://developer.aliyun.com/mirror/NPM
npm config set registry https://registry.npm.taobao.org
or you can also install a
cnpm rather than
npm, to avoid change the source url permanently.
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
Same as npm.
yarn config set registry https://registry.npm.taobao.org --global
there is no
change sourcelist, check this post
change homebrew core source and repo to USTC (University of Science and Technology of China) Mirror.
cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
change homebrew bottles source
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc