db.coll.find().forEach(doc => {})
db.coll.find().forEach(doc => { // ... change doc
// update
| # 1. 公司电脑打开 远程登录 功能 | |
| # 2. 公司电脑连接到 服务器,并监听服务器本地 3456 端口 | |
| # 当有链接到服务器 3456 时,tunnel 回公司电脑的 22 端口,及 sshd 服务 | |
| ssh -NR 3456:localhost:22 server | |
| # 3. 在家链接公司服务器 3456 端口 | |
| # 假设服务器登录时不需要输入密码。 |
| 1. Map 没有来自 Object.prototype 的属性,比如: __proto__, toString | |
| 2. Map 中的key可以是任何类型,Object 只能是 String | |
| 3. Map 对象迭代时的顺序与加入时的顺序一致。 | |
| ref: https://ponyfoo.com/articles/es6-maps-in-depth |
| # Write a function gcd(x,y) that finds the greatest common divisor between two nonnegative integers. | |
| # Algebraically, gcd(x,y) is x if y is zero; it’s gcd(y, rem(x,y)) otherwise. | |
| defmodule Mathx do | |
| def gcd(x, 0) do | |
| x | |
| end | |
| def gcd(x, y) do | |
| gcd(y, rem(x,y) | |
| end |
| %.csv : %.json | |
| @cat $< | $(MAKE) -s words | $(MAKE) -s csv > $@ | |
| # { | |
| # "code": "0", | |
| # "data": { | |
| # "block": [ | |
| # { | |
| # "type": "text", | |
| # "line": [ |
| function * fab (max) { | |
| let [n, a, b] = [0, 0, 1] | |
| while (n++ < max) { | |
| [a, b] = [b, a + b] | |
| yield b | |
| } | |
| } | |
| for (let n of fab(5)) { | |
| console.log(n) |
| { | |
| // Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and | |
| // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
| // same ids are connected. | |
| // Example: | |
| // "Print to console": { | |
| // "prefix": "log", | |
| // "body": [ | |
| // "console.log('$1');", |
| { | |
| // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
| // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
| // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
| // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
| // Placeholders with the same ids are connected. | |
| // Example: | |
| // "Print to console": { | |
| // "scope": "javascript,typescript", |
| // https://github.com/nuxt/example-auth0/blob/master/utils/auth.js | |
| const getQueryParams = () => { | |
| const params = {} | |
| window.location.href.replace(/([^(?|#)=&]+)(=([^&]*))?/g, ($0, $1, $2, $3) => { | |
| params[$1] = $3 | |
| }) | |
| return params | |
| } |
| -- see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this | |
| -- cards are what you review. easy! | |
| CREATE TABLE cards ( | |
| id integer primary key, | |
| -- the epoch milliseconds of when the card was created | |
| nid integer not null, | |
| -- notes.id | |
| did integer not null, | |
| -- deck id (available in col table) |