Skip to content

Instantly share code, notes, and snippets.

@kwelch
Last active November 14, 2017 03:11
Show Gist options
  • Save kwelch/aee809dd032faaeb7bc73217336d6a0c to your computer and use it in GitHub Desktop.
Save kwelch/aee809dd032faaeb7bc73217336d6a0c to your computer and use it in GitHub Desktop.
daily-notes

Morning Checklist

  • Review yesterday's notes

TODO

Notes

function daily-notes {
notes_file="$HOME/Documents/notes/daily/`date +%Y%m%d`.md"
if [ ! -f $notes_file ]; then
cp "$HOME/Documents/notes/daily-notes-template.md" $notes_file
fi
counter=1
max_days=31
notes_to_open="$notes_file"
previous_notes="$HOME/Documents/notes/daily/`date -v-${counter}d +%Y%m%d`.md"
until [ -f $previous_notes -o $counter -gt $max_days ]; do
counter=$((counter+1))
previous_notes="$HOME/Documents/notes/daily/`date -v-${counter}d +%Y%m%d`.md"
done
if [ -f $previous_notes ]; then
notes_to_open="$previous_notes ${notes_to_open}"
fi
macdown $notes_to_open
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment