Compare commits
3 Commits
38bcdd15cc
...
72d624ec95
Author | SHA1 | Date | |
---|---|---|---|
72d624ec95 | |||
5b3a12d628 | |||
f666ac3dc9 |
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "tree"
|
title: "tree"
|
||||||
tags: [ "basics" ]
|
tags: [ "basics", "tree", "markdown" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
The `tree` utility outputs a full listing of everything in your current directory, and those below.
|
The `tree` utility outputs a full listing of everything in your current directory, and those below.
|
||||||
@ -23,3 +23,14 @@ README.md
|
|||||||
```
|
```
|
||||||
|
|
||||||
Each description-line starts with a tab.
|
Each description-line starts with a tab.
|
||||||
|
|
||||||
|
## Markdown Conversion
|
||||||
|
|
||||||
|
To represent a file structure as a nested series of markdown lists, you can try this horrifying `sed` one-liner:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tree -tf --dirsfirst --gitignore --noreport --charset ascii | \
|
||||||
|
sed -e 's/| \+/ /g' \
|
||||||
|
-e 's/[|`]-\+/ */g' \
|
||||||
|
-e 's:\(* \)\(\(.*/\)\([^/]\+\)\):\1[\4](\2):g'
|
||||||
|
```
|
||||||
|
29
data/git/hooks.md
Normal file
29
data/git/hooks.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: "git hooks"
|
||||||
|
tags: [ "Documentation", "data", "git" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Check out the sample hooks:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd $GIT_REPO
|
||||||
|
ls .git/hooks
|
||||||
|
head .git/hooks/pre-commit.sample
|
||||||
|
```
|
||||||
|
|
||||||
|
Add a hook to check the shell scripts in `$GIT_REPO` before making a commit:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo '#!/bin/sh
|
||||||
|
shellcheck *.sh' > .git/hooks/commit-msg
|
||||||
|
chmod u+x .git/hooks/commit-msg
|
||||||
|
```
|
||||||
|
|
||||||
|
## Committing
|
||||||
|
|
||||||
|
Your `git hooks` will not enter the repository, but you can commit them to a repository, then request others add these git hooks to their own branch, by putting a note in the project's `README.md`.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
The project comes with recommended git hooks.
|
||||||
|
You can activate the hooks with `git config core.hooksPath hooks`.
|
||||||
|
```
|
21
data/sqlite.md
Normal file
21
data/sqlite.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
title: "sqlite"
|
||||||
|
tags: [ "Documentation", "data" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Work with a database:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sqlite3 "$FILE".sqlite3
|
||||||
|
```
|
||||||
|
Compress the database:
|
||||||
|
|
||||||
|
```sqlite
|
||||||
|
pragma vacuum;
|
||||||
|
```
|
||||||
|
Optimize the database:
|
||||||
|
|
||||||
|
```sqlite
|
||||||
|
pragma optimize;
|
||||||
|
```
|
||||||
|
|
2
new.sh
2
new.sh
@ -14,7 +14,7 @@ filePath="$category/$(echo $name | sed 's/ /_/g').md"
|
|||||||
|
|
||||||
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
|
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
|
||||||
|
|
||||||
[ -e "$filePath" ] && $EDITOR $filePath && exit 0
|
[ -e "$filePath" ] && $EDITOR "$filePath" && exit 0
|
||||||
|
|
||||||
echo "---
|
echo "---
|
||||||
title: \"$name\"
|
title: \"$name\"
|
||||||
|
Loading…
Reference in New Issue
Block a user