fuzzyworld

template / files / internal / core / defaults.yaml

defaults.yaml

10.9 KB · history · blame

1profiles:
2 - name: daily
3 description: Creates a MD file in ~/DailyNotes folder in the format YYYY-MM-DD[-vX].md
4 type: file
5 runpostscriptonfailure: true
6 postscripts:
7 - code . {{ if .FullPath }}"{{.FullPath}}"{{else}}(ls -t | head -n1){{ end }}
8 namepatterns:
9 - '{{$version := getVersion}}{{.YYYY_MM_DD}}{{if .ProjectName}}-{{.ProjectName | snakecase }}{{end}}{{if (gt $version 1)}}v{{$version}}{{end}}.md'
10 targetdirectory: ~/DailyNotes
11 filetemplate: |-
12 # {{.FileNameWithoutExtension}}
13
14 Today's notes for {{.Year}}-{{.Month}}-{{.Day}}.
15
16 ## Todo
17
18 1. Check email
19 2. Check chat
20 3. Check calendar
21 4. Check yesterday's notes
22 5. Have fun!
23 6. ADD MORE ITEMS HERE
24 - name: note
25 description: Creates a MD file in ~/Notes in the format YYYY-MM-DD[-ProjectName][-vVersion].md
26 type: file
27 os: All
28 postscripts:
29 - code "{{.FullPath}}"
30 namepatterns:
31 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}n{{$version}}{{end}}.md'
32 targetdirectory: ~/Notes
33 - name: note-here
34 description: Creates a MD file in the current folder in the format YYYY-MM-DD[-HH[-MM[-SS]]][-ProjectName][-vVersion].md
35 isdefault: true
36 type: file
37 os: All
38 postscripts:
39 - code "{{.FullPath}}"
40 namepatterns:
41 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}n{{$version}}{{end}}.md'
42 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}n{{$version}}{{end}}.md'
43 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}n{{$version}}{{end}}.md'
44 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}n{{$version}}{{end}}.md'
45 targetdirectory: .
46 - name: blog
47 description: Creates a MD file in the ~/Blog folder in the format YYYY-MM-DD[-ProjectName][-vVersion].md
48 type: file
49 os: All
50 postscripts:
51 - code . "{{.FileName}}"
52 namepatterns:
53 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName | snakecase }}{{end}}{{if (gt $version 1)}}v{{$version}}{{end}}.md'
54 targetdirectory: ~/Blog
55 filetemplate: |
56 # {{.ProjectName}}
57
58 Created by template, on {{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}.
59
60 ## Spelling
61
62 cspell:words nanite
63
64 ## Removed writing
65
66 ## Writing
67 - name: work-win
68 description: Creates a folder in the c:/work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]
69 type: folder
70 os: Windows
71 postscripts:
72 - explorer "{{.Path}}"
73 namepatterns:
74 - '{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
75 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
76 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
77 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
78 targetdirectory: C:/work
79 - name: therapy
80 description: Creates a MD file in the ~/Therapy folder in the format YYYY-MM-DD[-vVersion].md
81 type: file
82 os: All
83 postscripts:
84 - code . {{.FullPath}}
85 namepatterns:
86 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}{{if (gt $version 1)}}v{{$version}}{{end}}.md'
87 targetdirectory: ~/Therapy
88 filetemplate: |
89 # {{if .ProjectName}}{{.ProjectName}}{{else}}Therapy notes{{end}}
90
91 {{if .ProjectName}}Therapy notes on {{.ProjectName}}{{else}}Therapy notes{{end}}
92
93 ## Spelling
94
95 cspell:words cromulent embiggen
96
97 ## Writing
98
99 {{if .ProjectName}}Hello {{.ProjectName}},{{else}}Hello,{{end}}
100
101 Start writing here...
102
103 Sincerely, me
104 - name: work
105 description: Creates a folder in the ~/Work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]
106 type: folder
107 postscripts:
108 - code .
109 - chmod +x repro.sh
110 namepatterns:
111 - '{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
112 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
113 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
114 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
115 targetdirectory: ~/Work
116 files:
117 - name: README.md
118 file: |
119 # {{.ProjectName}}
120
121 Work notes on {{.ProjectName}}
122 - name: repro.sh
123 file: |-
124 clear
125
126 echo "Let's test {{.ProjectName}}!"
127 - name: .vscode/launch.json
128 file: |-
129 {
130 "version": "0.2.0",
131 "configurations": [
132 {
133 "type": "bashdb",
134 "request": "launch",
135 "name": "Debug repo.sh",
136 "cwd": "${workspaceFolder}",
137 "program": "${workspaceFolder}/repro.sh",
138 "terminalKind": "integrated"
139 }
140 ]
141 }
142
143 - name: folder
144 description: Creates a folder in the current folder in the format YYYY-MM-DD[-ProjectName][-vVersion]
145 type: folder
146 namepatterns:
147 - '{{$version := getVersion}}{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}-n{{$version}}{{end}}'
148 targetdirectory: .
149 - name: create-react-app
150 description: Creates a folder in the current folder in the format create-react-app[-ProjectName][-vVersion], runs `npx create-react-app` to initialize the folder, and opens the folder in VSCode
151 type: folder
152 postscripts:
153 - npx create-react-app .
154 - code .
155 namepatterns:
156 - '{{$version := getVersion}}create-react-app{{if .ProjectName}}-{{.ProjectName}}{{end}}{{if (gt $version 1)}}-n{{$version}}{{end}}'
157 targetdirectory: .
158 - name: git
159 description: Creates a folder in the ~/code folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]
160 type: folder
161 postscripts:
162 - git init
163 - code .
164 namepatterns:
165 - '{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
166 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
167 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
168 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
169 targetdirectory: ~/code
170 - name: git-clone
171 description: DISABLED - Clones a repository into a new folder under ~/code in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]
172 isdisabled: true
173 type: folder
174 postscripts:
175 - git clone {{.Url}} .
176 - code .
177 namepatterns:
178 - '{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
179 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
180 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
181 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}'
182 targetdirectory: ~/code
183 - name: log
184 description: Creates a log file in the current folder
185 type: file
186 postscripts:
187 - code . {{.FullPath}}
188 namepatterns:
189 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}.log'
190 targetdirectory: .
191 - name: dolt
192 description: Creates a `YYYY-MM-DD-ProjectName` folder for testing SQL in dolt and MySQL
193 type: folder
194 postscripts:
195 - code .
196 - chmod +x repro.sh
197 namepatterns:
198 - '{{.Year}}-{{.Month}}-{{.Day}}-{{.ProjectName}}'
199 targetdirectory: ~/Work
200 files:
201 - name: README.md
202 file: |-
203 # {{.ProjectName}}
204
205 Work notes on {{.ProjectName}}
206 - name: .vscode/launch.json
207 file: |-
208 {
209 // Use IntelliSense to learn about possible attributes.
210 // Hover to view descriptions of existing attributes.
211 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
212 "version": "0.2.0",
213 "configurations": [
214 {
215 "type": "bashdb",
216 "request": "launch",
217 "name": "Debug repo.sh",
218 "cwd": "${workspaceFolder}",
219 "program": "${workspaceFolder}/repro.sh",
220 "terminalKind": "integrated"
221 }
222 ]
223 }
224 - name: repro.sh
225 file: |-
226 clear
227
228 echo "Let's test {{.ProjectName}}!"
229
230 echo "setting up dolt"
231 rm -rf db
232 mkdir db
233 cd db
234 dolt init
235 dolt version
236
237 echo "running against dolt $(dolt version)"
238
239 echo "dolt setup.sql"
240 echo ">>>>>>>>>>>>>>>>>>>>>>"
241 dolt sql < ../setup.sql
242 echo "<<<<<<<<<<<<<<<<<<<<<<"
243
244 echo "dolt test.sql"
245 echo ">>>>>>>>>>>>>>>>>>>>>>"
246 dolt sql < ../test.sql
247 echo "<<<<<<<<<<<<<<<<<<<<<<"
248
249 echo "mysql start"
250 mysql.server start
251 mysql -u root -e "drop database if exists db; create database db;"
252
253 echo "mysql setup.sql"
254 echo ">>>>>>>>>>>>>>>>>>>>>>"
255 cat ../setup.sql | mysql -u root --table
256 echo "<<<<<<<<<<<<<<<<<<<<<<"
257
258 echo "mysql test.sql"
259 echo ">>>>>>>>>>>>>>>>>>>>>>"
260 cat ../test.sql | mysql -u root --table
261 echo "<<<<<<<<<<<<<<<<<<<<<<"
262
263 echo "stop mysql"
264 killall mysqld mysqld_safe
265 - name: setup.sql
266 file: |-
267 use db;
268
269 SET foreign_key_checks=0;
270
271 CREATE TABLE t(a INT, b INT);
272 INSERT INTO t(a, b) VALUES
273 (1, 1),
274 (1, 2),
275 (1, 3),
276 (2, 4),
277 (2, 5),
278 (2, 6);
279
280 SET foreign_key_checks=1;
281 - name: test.sql
282 file: |-
283 use db;
284
285 SELECT SUM(b) OVER (PARTITION BY a) FROM t ORDER BY 1;
286 SELECT SUM(b) OVER () FROM t ORDER BY 1;
287 SELECT SUM(b) OVER (PARTITION BY a), SUM(b) OVER () FROM t;
288