Skip to content

Instantly share code, notes, and snippets.

@markwk
markwk / zettel_identifier_note_creator.bash
Created February 11, 2019 06:47
Generate a unique identifier for plain text file names, including optional title and opening in target app
#!/bin/bash
#
# Bash script to generate a unique identifier for file name
# Used for a Plain Text Writing, Knowledge or Notes System
#
# Allows for following Options:
# -o: opening file in a target program
# Additional Title or name appended to end of file name
#
# Examples
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@jryio
jryio / Prepend YAML Front Matter to Markdown Files
Last active July 12, 2023 12:06
Adding YAML front matter to markdown files (title)
# For each result of find call our script to run on the filename
$ find . -name "*.md" -print0 | xargs -0 -I file ./prepend.sh file