Scrivener 中使用markdown語(yǔ)法
Scrivener 使用了multimarkdown作為轉(zhuǎn)換工具蕾管,最新版是6.0齿拂,在github上最新版是5.4步鉴。支持非常強(qiáng)大的語(yǔ)法古劲,包括Latex斥赋。
http://fletcher.github.io/MultiMarkdown-5/MMD_Users_Guide.html
BeautifulSoup
效率
Beautiful Soup用lxml做解析器比用html5lib或Python內(nèi)置解析器速度快很多。
安裝 cchardet 后文檔的解碼的編碼檢測(cè)會(huì)速度更快产艾。
如果僅僅因?yàn)橄胍檎椅臋n中的<a>標(biāo)簽而將整片文檔進(jìn)行解析,實(shí)在是浪費(fèi)內(nèi)存和時(shí)間.最快的方法是從一開(kāi)始就把<a>標(biāo)簽以外的東西都忽略掉.
SoupStrainer 類可以定義文檔的某段內(nèi)容,這樣搜索文檔時(shí)就不必先解析整篇文檔,只會(huì)解析在 SoupStrainer 中定義過(guò)的文檔. 創(chuàng)建一個(gè) SoupStrainer 對(duì)象并作為 parse_only 參數(shù)給 BeautifulSoup 的構(gòu)造方法即可疤剑。
編碼
Beautiful Soup輸出是會(huì)將HTML中的特殊字符轉(zhuǎn)換成Unicode,比如“&lquot;”:
soup = BeautifulSoup("“Dammit!” he said.")
unicode(soup)
# u'<html><head></head><body>\u201cDammit!\u201d he said.</body></html>'
如果將文檔轉(zhuǎn)換成字符串,Unicode編碼會(huì)被編碼成UTF-8.這樣就無(wú)法正確顯示HTML特殊字符了:
str(soup)
# '<html><head></head><body>\xe2\x80\x9cDammit!\xe2\x80\x9d he said.</body></html>'
apt-fast 多線程下載
https://www.htcp.net/3284.html
注意其中移動(dòng)語(yǔ)句應(yīng)該為
sudo mv /your_dir/apt-fast.sh /usr/bin/apt-fast
目的地目錄沒(méi)有l(wèi)ocal,是作者筆誤闷堡。
/usr/bin/dpkg returned an error code (1)
For me these two lines helped! Just remove all the linux-extra and linux-extra-image files, which are problematic and old.
For each package:
sudo mv /var/lib/dpkg/info/<PACKAGE-NAME>.* /tmp/
Then:
sudo apt-get autoremove && sudo apt-get autoclean