Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr2145 :: Daily notes and todo list with markdown

How I use markdown and git to keep up with what I do

<< First, < Previous, , Latest >>

Hosted by norrist on Friday, 2016-10-21 is flagged as Clean and is released under a CC-BY-SA license.
Markdown, git, Bash. 6.
The show is available on the Internet Archive at: https://archive.org/details/hpr2145

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:24:50

general.

Using Markdown and git to store your todo list and daily journal

Why markdown
  • No distractions
  • Simple syntax
  • Plain text, Human readable.
  • Inline HTML
  • Easy conversion to other formats
Why git
  • Any SCM probably OK
  • Github and Gitlab render markdown.
The todo page
    # TODO

    ### Can do now
    * Bullet 1
    * Bullet 2

    ### Near term
    1. Numbered 1
    1. Numbered 2

    ### Long term
The journal script
    DAILYFILE="/Users/norrist/Projects/todo/daily/$(/bin/date +%F).md"
    DAILYPATH="/Users/norrist/Projects/todo/daily/"
    LOCKFILE="/Users/norrist/Projects/todo/daily/LOCK"
    TODOFILE="/Users/norrist/Projects/todo/todo.md"

    if [ -f $LOCKFILE ]
        then
            echo "$LOCKFILE PRESENT - ABORTING"
            read -n1 -p "Remove and Continue? [y,n]" doit
                case $doit in
                    y|Y) echo "Continuing with $LOCKFILE PRESENT" ;;
                    *) exit 1 ;;
                esac


        else
            echo "NO LOKCFILE"
            touch $LOCKFILE

    fi


    if [ -f $DAILYFILE ]
        then
            echo "$DAILYFILE exists"
        else
            echo  >> $DAILYFILE
            echo  "-----">> $DAILYFILE
            echo "# $(/bin/date +%F)" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Projects" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Tickets" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Walkups" >> $DAILYFILE
    fi

    /usr/local/bin/edit -w --new-window $DAILYFILE
    /opt/local/bin/aspell -c $DAILYFILE
    /opt/local/bin/aspell -c $TODOFILE

    rm $LOCKFILE
    rm $DAILYPATH/README.md

    cat $TODOFILE >> $DAILYPATH/README.md

    for f in $(ls  -r $DAILYPATH/2*md)
     do cat $f >> $DAILYPATH/README.md
     echo >>$DAILYPATH/README.md
     done

    cd /Users/norrist/Projects/todo; /usr/bin/git add . && /usr/bin/git commit -m "$(date)" && /usr/bin/git push origin master

Daily file template

    # 2016-08-02

    -----

    ### Projects

    ### Tickets

    ### Walkups
aspell is awesome

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2016-10-21 06:05:01 by b-yeezi

Love this Idea

Thanks for this show. I agree with your reasons for using markdown. It gets out of your way so you can write. I also find the idea of using git interesting, but I would be concerned about privacy. I guess you can host your own gitlab...

Can't wait for your next show.

Comment #2 posted on 2016-10-24 15:07:12 by Fin

Nice! Licence?

Nice show! Sweet script! Is it up on a public git repo somewhere?

TL;DR Would you mind adding a licence?

You might think of it as just a little, personal convenience script that doesn't mean much, that anyone can adapt if they please right? But, technically speaking, you've got the copyright (by default) and I can't legally use this code.

You may consider it open source by being on a web page that is covered by the CC-BY-SA licence but they advise against it's use for software as it doesn't explicitly cover distribution of source code (see https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software).

I ask you to consider adding a licence to make it clear what people can do with your script. I'd sure love to use it but, if I make changes and want to share it, we're in a grey area ;)

Comment #3 posted on 2016-10-25 23:04:41 by norrist

Version with copyright notice

Thanks for the feedback. Here is a link to the script with an ISC license header.

https://norrist.devio.us/pub/todo.sh


Comment #4 posted on 2016-11-30 20:47:38 by Matt

question about the script

I love your script idea and will probably be copying lots of it. THANKS!

however, in the last "for" loop where you cat your files into the new "README" file, i don't understand this bit:

$(ls -r $DAILYPATH/2*md)

more specifically, the "2*/md" bit. Is this some kind of BASH specific notation? Is this a Mac thing?

OTW, great episode and very helpful!

cheers,
matt

Comment #5 posted on 2016-12-01 16:58:29 by norrist

"2*/md"

There isnt anything special about "2*/md". All the files that I want combined into the readme are named by date and have the md suffix. so "2*/md" matches 2016-12-01.md as well as all the other daily files. The only reason for "2*/md" to be there is incase I have some other files in the directory that I dont want included in the readme.

Comment #6 posted on 2016-12-04 00:08:05 by Matt

of course!

thanks... i wasn't thinking about dates starting with 2... duh

Cheers,
matt

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?