Skip to content

Instantly share code, notes, and snippets.

@asigner
Created April 15, 2020 06:55
Show Gist options
  • Save asigner/0795ea706cdbcee19e8de64b457d24df to your computer and use it in GitHub Desktop.
Save asigner/0795ea706cdbcee19e8de64b457d24df to your computer and use it in GitHub Desktop.
# Function to create a journal entry for the day and open it in VSCode.
# The following structure is create in $HOME/wiki or $WIKI_ROOT when set.
#
# journal:
# - 2019:
# - 12-December:
# - 2020-12-24.md
# - 2020-12-25.md
# - 2020-12-26.md
# - 2020:
# - 01-Januar:
# - 2020-01-01.md
# - 2020-01-02.md
function jc {
mkdir -p "${WIKI_ROOT:-$HOME/wiki}/journal/$(date +'%Y/%m-%B')" \
&& code --folder-uri="${WIKI_ROOT:-$HOME/wiki}" --file-uri="${WIKI_ROOT:-$HOME/wiki}/journal/$(date +'%Y/%m-%B/%Y-%m-%d.md')"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment