Revision | 45ba7d5d746b6fae201a04be6281918d2668e24b (tree) |
---|---|
Time | 2023-01-31 23:55:05 |
Author | Erik <erikgronwal@user...> |
Commiter | Erik |
Regular updates
@@ -187,7 +187,9 @@ dir=${src%$base} #=> "/path/to/" (dirpath) | ||
187 | 187 | | `${foo#prefix}` | Remove prefix | |
188 | 188 | | --- | --- | |
189 | 189 | | `${foo%%suffix}` | Remove long suffix | |
190 | +| `${foo/%suffix}` | Remove long suffix | | |
190 | 191 | | `${foo##prefix}` | Remove long prefix | |
192 | +| `${foo/#prefix}` | Remove long prefix | | |
191 | 193 | | --- | --- | |
192 | 194 | | `${foo/from/to}` | Replace first match | |
193 | 195 | | `${foo//from/to}` | Replace all | |
@@ -80,7 +80,7 @@ curl -u user:pass -d status="Hello" http://twitter.com/statuses/update.xml | ||
80 | 80 | |
81 | 81 | ```bash |
82 | 82 | # multipart file upload |
83 | -curl -v -include --form key1=value1 --form upload=@localfilename URL | |
83 | +curl -v --include --form key1=value1 --form upload=@localfilename URL | |
84 | 84 | |
85 | 85 | # multipart form: send data from text field and upload file |
86 | 86 | curl -F person=anonymous -F secret=@file.txt http://example.com/submit.cgi |
@@ -66,7 +66,7 @@ These conditions only work in MacOS and BSD-like systems (no GNU/Linux support). | ||
66 | 66 | ### Condition flow |
67 | 67 | |
68 | 68 | ```bash |
69 | -\! -name "*.c" | |
69 | +\! -name "*.c" # NOT named "*.c" | |
70 | 70 | \( x -or y \) |
71 | 71 | ``` |
72 | 72 |
@@ -91,4 +91,5 @@ find . -newerBt "24 hours ago" | ||
91 | 91 | |
92 | 92 | ```bash |
93 | 93 | find . -type f -mtime +29 # find files modified more than 30 days ago |
94 | +find . -type f -newermt 2016-08-07 \! -newermt 2016-08-08 # find in date range | |
94 | 95 | ``` |
@@ -17,6 +17,11 @@ updated: 2019-12-24 | ||
17 | 17 | | `npm install lodash` | Install a package | |
18 | 18 | | `npm install --save-dev lodash` | Install as devDependency | |
19 | 19 | | `npm install --save-exact lodash` | Install with exact | |
20 | +| --- | --- | | |
21 | +| `npm version 1.2.3` | Bump the package version to 1.2.3 | | |
22 | +| `npm version major` | Bump the major package version by 1 (1.2.3 → 2.0.0) | | |
23 | +| `npm version minor` | Bump the minor package version by 1 (1.2.3 → 1.3.0) | | |
24 | +| `npm version patch` | Bump the patch package version by 1 (1.2.3 → 1.2.4) | | |
20 | 25 | |
21 | 26 | |
22 | 27 | `--save` is the default as of npm@5. Previously, using `npm install` without `--save` doesn't update package.json. |
@@ -5,12 +5,45 @@ layout: 2017/sheet | ||
5 | 5 | prism_languages: [yaml] |
6 | 6 | --- |
7 | 7 | |
8 | +### Dictionaries and lists | |
9 | + | |
10 | +```yaml | |
11 | +# comments start with "#" | |
12 | +# dictionary are written like "key: value" | |
13 | +name: Martin D'vloper | |
14 | +languages: | |
15 | + perl: Elite | |
16 | + python: Elite | |
17 | + pascal: Lame | |
18 | + | |
19 | +# list items beginn with a "- " | |
20 | +foods: | |
21 | + - Apple | |
22 | + - Orange | |
23 | + - Strawberry | |
24 | + - Mango | |
25 | + | |
26 | +# booleans are lower case | |
27 | +employed: true | |
28 | +``` | |
29 | + | |
30 | + | |
8 | 31 | ### Multiline strings |
9 | 32 | |
10 | 33 | ```yaml |
34 | +# Literal Block Scalar | |
11 | 35 | Multiline: | |
12 | - hello | |
13 | - world | |
36 | + exactly as you see | |
37 | + will appear these three | |
38 | + lines of poetry | |
39 | +``` | |
40 | + | |
41 | +```yaml | |
42 | +# Folded Block Scalar | |
43 | +Multiline: < | |
44 | + this is really a | |
45 | + single line of text | |
46 | + despite appearances | |
14 | 47 | ``` |
15 | 48 | |
16 | 49 | ### Inheritance |