Skip to content

Instantly share code, notes, and snippets.

@gogobook
gogobook / docx2md.md
Created June 29, 2018 13:59 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in Two Moves

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

The Solution

As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.

Javascript 的测试, 不管在用 jasmine 还是 mocha, 都是很头疼的事情. 但是自从有了 jest, 一口气写7个测试, 腰也不疼了, 头也不疼了.

只需要 3 个理由

在说用 jest 测为什么好之前,我们先来看我们要测的一个例子.

@gogobook
gogobook / tokio-internals.md
Created February 21, 2018 13:03 — forked from weihanglo/tokio-internals.md
【譯】Tokio 內部機制:從頭理解 Rust 非同步 I/O 框架

本文譯自 [Tokio internals: Understanding Rust's asynchronous I/O framework from the bottom up][tokio-internals]。
Thanks [David Simmons][david-simmons] for this awesome article!

[Tokio][tokio] 是 Rust 的開發框架,用於開發非同步 I/O 程式(asynchronous I/O,一種事件驅動的作法,可實現比傳統同步 I/O 更好的延伸性、效能與資源利用)。可惜的是,Tokio 過於精密的抽象設計,招致難以學習的惡名。即使我讀完教程後,依然不認為自己充分內化這些抽象層,以便推斷實際發生的事情。

從前的非同步 I/O 相關開發經驗甚至阻礙我學習 Tokio。我習慣使用作業系統提供的 selection 工具(例如 Linux epoll)當作起點,再轉移至 dispatch、state machine 等等。倘若直接從 Tokio 抽象層出發,卻沒有清楚了解 epoll_wait() 在何處及如何發生,我會覺得難以連結每個概念。Tokio 與 future-driven 的方法就好像一個黑盒子。

@gogobook
gogobook / rxjs_operators_by_example.md
Created October 13, 2017 02:34 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
// 模擬 indicator 顯示/隱藏狀態
let indicator = Variable(false)
// 按鈕
lazy var loginButton: UIButton = {
let button = UIButton(type: .system)
button.tintColor = UIColor.red
button.setTitle("登入", for: .normal)
return button
}()
@gogobook
gogobook / Angular 4 開發環境說明.md
Created May 12, 2017 01:18 — forked from doggy8088/Angular 17 Dev Setup.md
Angular 4 開發環境說明

Angular 4 開發環境說明

為了能讓大家能夠順利的建立起 Angular 4 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

[ 作業系統 ]

  • Windows 7 以上版本 (更新到最新 Service Pack 版本)
  • Mac OS X 10.6 以上版本

[ 套件管理器 ( Mac OS X Only ) ]

@gogobook
gogobook / introrx.md
Created June 28, 2016 07:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@gogobook
gogobook / config-highlight.cfg
Created September 23, 2015 07:00 — forked from jaimergp/config-highlight.cfg
Dark highlighting theme for Python IDLE based on SublimeText's Monokai color scheme
# Place this file inside your ~/.idlerc/ folder
# or paste its contents inside
# /path/to/python/idlelib/config-highlight.def
# Adapted from SublimeText's Monokai
[monokai]
normal-foreground= #F8F8F2
normal-background= #272822
keyword-foreground= #F92672
keyword-background= #272822