LIST

reload blog v2

rm -r static/resources content/blog content/filing* public cp -pr ~/Downloads/yarle-run/output8/notes/evernote.toc.titled/all/blog ./content/ cp -pr ~/Downloads/yarle-run/output8/notes/evernote.toc/filing/filing-* ./content/ mv content/blog/resources static rm -r content/filing-learning-notes/resources rm -r content/filing-web/resources fix title with quotes breaking frontmatter fix title with quotes breaking frontmatter blog sed tag published to draft blog sed tag published to draft blog sed fix missing tags blog sed fix missing tags blog sed fix hashtag in frontmatter tags blog sed fix hashtag in frontmatter tags...

September 3, 2024

blog sed fix hashtag in frontmatter tags

content-fix-frontmatter-hashtag.sed /^tags: .*"#".*$/s/"#","#"/"starred"/g /^tags: .*"#".*$/s/"#"/"starred"/g /^tags: .*#.*$/s/#//g Speedrun find content/blog -type f -name '*.md' -exec sed -i "" -f content-fix-frontmatter-hashtag.sed {} \;

August 19, 2024

blog sed fix missing tags

which files grep -LR '^tags: ' content/everblog | grep ".md$" single file fix sed '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' content/everblog/opinion-stop-wasting-a-perfectly-good-bug.md merge echo 'content/everblog/insight-heroes-journey-why.md' | xargs -I {} sed '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' {} Speedrun grep -LR '^tags: ' content/blog | grep ".md$" | xargs -I {} sed -i "" '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' {}

August 19, 2024

blog sed tag published to draft

sed -e '/---/,/---/s/^\(tags: .*"#published".*\)$/\1\ndraft: false/' -e t -e '/---/,/---/s/^\(tags: .*\)$/\1\ndraft: true/' -e t -e '2n; /---/i\ draft: true' content/blog/article-on-the-diverse-and-fantastical-shapes-of-testing-martin-fowler.md | head content-parse-draft-from-published-tag.sed /^---$/,/^---$/s/^\(tags: .*"#published".*\)$/\1\ndraft: false/ t /^---$/,/^---$/s/^\(tags: .*\)$/\1\ndraft: true/ Speedrun find content/blog -type f -name '*.md' -exec sed -i "" -f content-parse-draft-from-published-tag.sed {} \;

August 19, 2024

reload blog

rm -r static/resources rm -r content/everblog rm -r public cp -r ~/Downloads/yarle-run/output4/notes/Blog content/everblog mv content/everblog/resources static fix title with quotes breaking frontmatter grep -R 'title: ".*".*"$' ./content/everblog | sed 's/:.*//' | sed 's!^\(.*\)!sed -i "" -e '"'"'/^title: ".*".*"$/s/"//g'"'"' -e '"'"'/^title: [^"]*$/s/title: \\(.*\\)/title: "\\1"/'"'"' "\1"! ' | zsh parse draft/no-draft blog sed tag published to draft find content/everblog -type f -name '*.md' -exec sed -i "" -f content-parse-draft-from-published-tag.sed {} \; #todo: fix title with _ should be :...

August 6, 2024

xq xml query evernote enex

random util some stuff from my history 3881 xq ~/Downloads/yarle-test/input/foo_export_test.enex 'del(.note)' 3882 xq 'del(.note)' ~/Downloads/yarle-test/input/foo_export_test.enex 3883 xq 'del(.en-export)' ~/Downloads/yarle-test/input/foo_export_test.enex 3888 xq 'del(.en-export)' ~/Downloads/yarle-test/input/foo_export_test.enex 3889 xq 'del(.note)' ~/Downloads/yarle-test/input/foo_export_test.enex 3890 xq 'del(."en-export".note)' ~/Downloads/yarle-test/input/foo_export_test.enex 3891 xq 'del(."en-export".note)' ~/Downloads/yarle-test/input/export_test.enex 3892 xq ~/Downloads/yarle-test/input/export_test.enex 3893 xq '.' ~/Downloads/yarle-test/input/export_test.enex 3898 less Blog.enex ➜ ~ ls -l /opt/homebrew/bin/xq lrwxr-xr-x 1 tjen admin 32 3 jul 19:25 /opt/homebrew/bin/xq -> ../Cellar/python-yq/3.4.3/bin/xq strip content from xml xq 'del(."en-export".note[].content)' ~/Downloads/yarle-run/input/evernote.toc/all/Blog.enex { “en-export”: { “@export-date”: “20231213T100406Z”, “@application”: “Evernote”, “@version”: “10....

August 6, 2024

blog edit frontmatter

find . -type f -name "*.md" -exec sed -i ".bak" -e '/^---$/,/^---$/s/^ //' -e '/^---$/,/^---$/s/^created: \(.*\)$/date: \1\ncreated: \1/' -e '/^---$/,/^---$/s/^evernoteGuid: \(.*\)$/evernoteGuid: \1\nslug: \1/' -e '/^---$/,/^---$/s/^updated: \(.*\)$/updated: \1\nlastmod: \1/' {} \;

August 5, 2024

fix title with quotes breaking frontmatter

check if there are files that need fixing grep -R 'title: ".*".*"$' . | tee malformed-titles.txt (util) strip stuff that grep -R adds cat malformed-titles.txt | sed 's/.*\.md://' | (util) only keep filenames cat malformed-titles.txt | sed 's/:.*//' check that no existing files that would break -> this should be empty! grep -R '/^title: [^"]*$' . | tee conflicting-lines.txt (util) replace inline “make sure the previous check is empty!” sed -i \ -e '/^title: "....

July 14, 2024

yarle utimes mac M1 problem

git clone https://github.com/baileyherbert/utimes cd utimes npm i npm run build Then unzip build/stage/…/utimes-v0.0.0-napi-v3-darwin-arm64.tar.gz Copy to (from error message in yarle output: /Users/tjen/dev/tjen/yarle/node_modules/utimes/lib/binding/napi-v3/utimes.node)

July 3, 2024