Commit MetaInfo

修订版ac569451f3d0e5a3392e7ab456a56fb3adea1543 (tree)
时间2020-02-13 23:55:05
作者Erik <erikgronwal@user...>
CommiterErik

Log Message

Regular updates

更改概述

差异

--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,7 +5,7 @@ services:
55 volumes:
66 - .:/app
77 - rubygems:/usr/local/bundle
8- - node_modules:/app/node_modules
8+ - ./node_modules:/app/node_modules
99 ports:
1010 - '4001:4001'
1111 - '35729:35729'
--- a/emmet.md
+++ b/emmet.md
@@ -31,7 +31,7 @@ section>p+p+p
3131 Expands to
3232 ```html
3333 <section>
34- <p></p>
34+ <pt></p>
3535 <p></p>
3636 <p></p>
3737 </section>
--- a/enzyme.md
+++ b/enzyme.md
@@ -83,7 +83,7 @@ wrap.setState({ show: true })
8383 #### Asserting
8484
8585 ```js
86-expect(wrap.props('name')).toEqual('Moe')
86+expect(wrap.prop('name')).toEqual('Moe')
8787 expect(wrap.state('show')).toEqual(true)
8888 ```
8989
--- a/git-branch.md
+++ b/git-branch.md
@@ -64,12 +64,17 @@ Deletes the branch only if the changes have been pushed and merged with remote.
6464 git branch -D $branchname
6565 ```
6666
67-Delete a branch irrespective of its merged status.
67+```bash
68+git branch -d $branchname
69+```
70+
71+> Note: You can also use the -D flag which is synonymous with --delete --force instead of -d. This will delete the branch regardless of its merge status.
72+> Delete a branch irrespective of its merged status.
6873
6974 ### Delete remote branch
7075
7176 ```bash
72-git push origin :$branchname
77+git push origin --delete :$branchname
7378 ```
7479
7580 Works for tags, too!
--- a/go.md
+++ b/go.md
@@ -395,6 +395,39 @@ v, ok := <- ch
395395
396396 See: [Range and close](https://tour.golang.org/concurrency/4)
397397
398+### WaitGroup
399+
400+```go
401+import "sync"
402+
403+func main() {
404+ var wg sync.WaitGroup
405+
406+ for _, item := range itemList {
407+ // Increment WaitGroup Counter
408+ wg.Add(1)
409+ go doOperation(item)
410+ }
411+ // Wait for goroutines to finish
412+ wg.Wait()
413+
414+}
415+```
416+{: data-line="1,4,8,12"}
417+
418+```go
419+func doOperation(item string) {
420+ defer wg.Done()
421+ // do operation on item
422+ // ...
423+}
424+```
425+{: data-line="2"}
426+
427+A WaitGroup waits for a collection of goroutines to finish. The main goroutine calls Add to set the number of goroutines to wait for. The goroutine calls `wg.Done()` when it finishes.
428+See: [WaitGroup](https://golang.org/pkg/sync/#WaitGroup)
429+
430+
398431 ## Error control
399432
400433 ### Defer
--- a/moment.md
+++ b/moment.md
@@ -17,12 +17,11 @@ This parses the given date using the given format. Returns a moment object.
1717 ### Formatting
1818
1919 ```js
20-m
21- .format()
22- .format('dddd')
23- .format('MMM Do YY') // → "Sep 2nd 07"
24- .fromNow() // → "31 minutes ago"
25- .calendar() // → "Last Friday at 9:32PM"
20+m.format() // "2013-03-01T00:00:00+01:00"
21+m.format('dddd') // "Friday"
22+m.format('MMM Do YY') // "Mar 1st 13"
23+m.fromNow() // "7 years ago"
24+m.calendar() // "03/01/2013"
2625 ```
2726
2827 ### Add
--- a/phoenix-migrations.md
+++ b/phoenix-migrations.md
@@ -44,7 +44,7 @@ create table(:documents) do
4444 add :age, :integer
4545 add :price, :float
4646 add :price, :float, precision: 10, scale: 2
47- add :published_at, :datetime
47+ add :published_at, :utc_datetime
4848 add :group_id, references(:groups)
4949 add :object, :json
5050
--- a/rollup.md
+++ b/rollup.md
@@ -74,13 +74,13 @@ This creates `main.js` and `vendor.js`.
7474 #### Terminal
7575
7676 ```bash
77-npm install -D rollup-plugin-json
77+npm install -D @rollup/plugin-json
7878 ```
7979
8080 #### rollup.config.js
8181
8282 ```js
83-import json from 'rollup-plugin-json'
83+import json from '@rollup/plugin-json'
8484
8585 export default {
8686 input: 'src/main.js',
@@ -97,12 +97,12 @@ export default {
9797
9898 #### Terminal
9999 ```bash
100-npm install --save-dev rollup-plugin-node-resolve
100+npm install -D @rollup/plugin-node-resolve
101101 ```
102102
103103 #### rollup.config.js
104104 ```js
105-import resolve from 'rollup-plugin-node-resolve'
105+import resolve from '@rollup/plugin-node-resolve'
106106
107107 export default {
108108 input: 'src/main.js',
@@ -121,13 +121,13 @@ When you run a npm run build, no warning is emitted and contains the imported mo
121121 #### Terminal
122122
123123 ```bash
124-npm install -D rollup-plugin-node-resolve
124+npm install -D @rollup/plugin-node-resolve
125125 ```
126126
127127 #### rollup.config.js
128128
129129 ```js
130-import resolve from 'rollup-plugin-node-resolve'
130+import resolve from '@rollup/plugin-node-resolve'
131131
132132 export default {
133133 input: 'src/main.js',
@@ -157,7 +157,7 @@ npm install -D rollup-plugin-babel
157157 #### rollup.config.js
158158
159159 ```js
160-import resolve from 'rollup-plugin-node-resolve'
160+import resolve from '@rollup/plugin-node-resolve'
161161 import babel from 'rollup-plugin-babel'
162162
163163 export default {
--- a/tmux.md
+++ b/tmux.md
@@ -15,7 +15,7 @@ category: CLI
1515 $ tmux new -s session_name
1616
1717 $ tmux attach # Default session
18- $ tmux attach -s session_name
18+ $ tmux attach -t session_name
1919
2020 $ tmux switch -t session_name
2121
@@ -49,6 +49,7 @@ category: CLI
4949 C-b hkjl # navigation
5050 C-b HJKL # resize
5151 C-b o # next window
52+ C-b q # show pane numbers
5253 C-b x # close pane
5354
5455 C-b { or } # move windows around
--- a/vim.md
+++ b/vim.md
@@ -45,7 +45,7 @@ Getting started
4545 | Shortcut | Description |
4646 | --- | --- |
4747 | `b` _/_ `w` | Previous/next word |
48-| `e` _/_ `ge` | Previous/next end of word |
48+| `ge` _/_ `e` | Previous/next end of word |
4949 {: .-shortcuts}
5050
5151 #### Line
Show on old repository browser