Technically minded engineer with a passion for innovation.

Simplest Journal Solution

2019-01-29 Code

This is my simple journal solution. Put the code belowe in your ~/.zshrc or ~/.bashrc

Type a j from a terminal, type some notes, save and exit.

The script creates a file in the format of ~/journal/2019/ and automatically pushes it to git.

journal() {
    mkdir -p ~/journal/`date +%Y`
    $EDITOR ~/journal/`date +%Y`/`date`
    (cd ~/journal/; git pull; git add *; git commit -a -m "Update `date +%Y-%m-%d`"; git push)
alias j=journal

Easy, simple, effective.

comments powered by Disqus