Hacker News new | past | comments | ask | show | jobs | submit login

If you want something simpler:

    now() {
      echo $(date "+%Y-%m-%d %H:%M:%S") - "$@" >> $HOME/.now
    }
Usage:

    now "Working on Project A"
    now pause
    now continue
    now done
You won't get a nice report and you'll have to calculate hours yourself, but it supports every edge case you can think of. Need to back-date an entry? Just open the file and change the timestamp. Want to nest tasks? Just do `now $ working on sub task` and you can easily see the indentation.



I wrote something like that that also writes the cwd because that made it easier to go back and recall what project I was on if the comment didn't make it explicit.

Aliased it to '@'.

This is something people should write for themselves because the best usage comes from tailoring it to your own particular needs. Also, you have to maintain it then it may not get all featured-up and bloated. Maybe. :)


I was basically doing the same thing but I recorded what I just finished instead of what I was working on. I got that idea from gtimelog. I haven't been using it lately but I might go back to it.

    dun started
    dun Implemented feature xxx
    dun reddit and hn **
    dun Fixed bug xxx
    dun lunch **
    
Without an argument it just opened the log file in vim.

I like this style of recording things but I would like to be able to log back to a server from anywhere and have things like git commits added as well for additional context. And then there is report generation.


Modified to also record the elapsed times:

  # from https://news.ycombinator.com/item?id=7411120
  export NOW_FORMAT='%F %T'
  export NOW_FORMAT2='+%Y-%m-%d %H:%M:%S'
  export NOW_FILE="$HOME/.now"
  now() {
    if [ -e $NOW_FILE ] &&
       last_line=$(tail -n1 $NOW_FILE | cut -d " " -f 1,2) &&
       time0=$(date -j -f "$NOW_FORMAT" "$(tail -n1 $NOW_FILE)" "+%s") && 
       time1=$(date -j "+%s")
    then echo "ET $(( $time1 - $time0 ))" >> $NOW_FILE
    fi
    echo $(date +"$NOW_FORMAT") - "$@" >> $NOW_FILE
    tail $HOME/.now # show the last few lines
  }


use the .plan or .project files

then you can finger(1) and get info.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: