Skip to content

Instantly share code, notes, and snippets.

@albingeorge
Last active March 26, 2023 20:51
Show Gist options
  • Save albingeorge/e334eb3e33e76c5f2169d0b2b6477130 to your computer and use it in GitHub Desktop.
Save albingeorge/e334eb3e33e76c5f2169d0b2b6477130 to your computer and use it in GitHub Desktop.
Logs the input string to a dropbox directory and syncs across your devices
#!/bin/bash
# Logs the data to the dropbox directory
# Usage
# w "Created README"
# If no arguments are passed, it shows the last 20 entries
w() {
filename=~/Dropbox/tracker/$(date +%Y_%m_%d.log)
if [[ $# -eq 0 ]] ; then
tail -n 20 $filename
else
content="$(date +%H:%M:%S) - ${@}"
echo "$content" >> $filename
fi
}
# Opens today's work in Sublime
w_edit(){
filename=~/Dropbox/tracker/$(date +%Y_%m_%d.log)
subl $filename
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment