Posts
Emoji Support
· ☕ 1 分钟 · 👻 Kim
Guide to emoji usage in Hugo

Viz support
· ☕ 1 分钟
A hack to put Graphviz on the web.

Wavedrom support
· ☕ 1 分钟
WaveDrom is a Free and Open Source online digital timing diagram (waveform) rendering engine that uses javascript, HTML5 and SVG to convert a WaveJSON input text description into SVG vector graphics.

Chart support
· ☕ 1 分钟
Simple yet flexible JavaScript charting for designers & developers

Mermaid support
· ☕ 1 分钟
Generate diagrams, charts, graphs or flows from markdown-like text via javascript.

MathJax support
· ☕ 1 分钟
A JavaScript display engine for mathematics that works in all browsers.No more setup for readers. It just works.

Katex support
· ☕ 1 分钟
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

Flowchart support
· ☕ 1 分钟
flowchart.js is a flowchart DSL and SVG render that runs in the browser and terminal. Nodes and connections are defined in separately so that nodes can be reused and connections can be quickly changed.

Node.js 抓取中文网页乱码的若干问题
· ☕ 1 分钟

 

使用 iconv-lite 解决 request 乱码问题

Node.js 抓取非 utf-8 的中文网页时会出现乱码问题,比如网易的首页编码是 gb2312,抓取时会出现乱码

var request = require('request')  
var url = 'http://www.163.com'

request(url, function (err, res, body) {  
    console.log(body)
})

可以使用 iconv-lite 来解决