emmm...為了防止以后還會出現類似的情況丙笋,做下記錄= =
1. Ubuntu 16.04 apt-get update 出錯
問題描述:https://github.com/ximion/appstream/issues/35
問題解決:https://bugs.launchpad.net/ubuntu/+source/appstream/+bug/1579712
2. sublime 設置自動縮進
preference>>key bindings-user>>
[
{"keys":["shitf+ctrl+q],"command":"reindenr"},
]
linux用戶:
不知道為什么我在ubuntu里的sublime按照上面的方法不能格式化= =表蝙,于是在網上又找到了另一種方法聚凹。
用超級權限打開sublime(否則插件可能安裝后下次打開又不見了= =)
ctrl+shift+p
輸入ip击罪,看到instal package唆香,然后搜索CodeFormatter插件步氏,點擊安裝虐块,安裝好后設置快捷鍵俩滥,默認是ctrl+alt+f
3. Git代碼沖突
error: Your local changes to the following files would be overwritten by merge: protected/config/main.php
Please, commit your changes or stash them before you can merge.
如果希望保留生產服務器上所做的改動,僅僅并入新配置項, 處理方法如下:
git stash
git pull
git stash pop
然后可以使用git diff -w +文件名
來確認代碼自動合并的情況.
反過來,如果希望用代碼庫中的文件完全覆蓋本地工作版本. 方法如下:
git reset --hard
git pull
其中git reset是針對版本,如果想針對文件回退本地修改,使用:
git checkout HEAD file/to/restore
4. 安裝npm并更換國內源
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
安裝nodejs
sudo apt-get install -y nodejs
更換國內源
sudo npm config set registry https://registry.npm.taobao.org
5. apt 更新 停留在wait for headers
https://askubuntu.com/questions/156650/apt-get-update-very-slow-stuck-at-waiting-for-headers