Hacker News new | ask | show | jobs
by rkhassen 3060 days ago
hboon - that ability to run a script and see time spent from a text file sounds like a fantastic combo of simplicity to use and the ability to mine data. I'd love to see an example of your file format and script to see exactly how it all works together, if you are up for sharing.
3 comments

Forgot something:

One benefit with marking tasks with a @@. I move the current project I'm working in wip.md to the top, so if I do a search from the top for @@, the first hit will be the task I am currently working on. I wrote a plugin in https://getbitbar.com to put that first (and thus current task) in my menubar. I get distracted easily.. so every bit helps :)

I have another BitBar plugin that scans my wip.md file and run the same script (which I run end of the day) to compute totals and then put it in my menu bar. Since I have something like this:

    11:10 PM - 11:21 PM Mimic
    12:10 PM
It can detect the start time of my current task or how long since I haven't worked and display them in green or red in the menu bar.
I would love to see this as well. My workflow would benefit greatly from this.
Replied above.
Sure, here's an example from 2 days ago.

During the day, my wip.md file looks like this https://gist.githubusercontent.com/hboon/cd7ffa9ed94ce3a8bc8...

I abuse the Markdown format:

    * "projects" marked with headers, with a prefix :: so I can search for it

    * I mark "tasks" as done with an *

    * I mark uncompleted tasks with @@

    * When I start to work on a project, I add a line near the top with the start time and when I finish, I mark the end time too, using a vim macro.
I use MacVim all the time, so my wip.md is always open as the first tab. And I bind cmd+1 to it.

At the end of the day:

I run a vim macro which runs a script to generate the total time for each project ending up with: https://gist.githubusercontent.com/hboon/b8770dea077f67664d9...

I then go through it manually and delete the tasks that are still marked as @@ just keeping those with an asterisk. So this effectively becomes my journal for that day. I keep a short note under the Notes: line. For eg. I might say that I didn't work because I went out with my family, or if I'm sick. I delete those mark with an asterisk in wip.md, add more or tweak the remaining ones and I have the file ready for the next day. I do my daily review at this time, so the macro which I mentioned actually opens a few other files including one called on-deck which is basically where I can grab things over from to add to wip.md. Over the years, I sometimes end up with wip.md growing too much, making it quite inhibiting. I try to keep the wip.md to ~1 page so it's more manageable.

I'm ashamed to share the script which I wrote a few years ago :P But it's simple, it just goes through each line looking for a regex match for:

    11:10 PM - 11:21 PM Mimic
I have a config file that looks like this:

    [timelog]

    projects=Everyday,Marketing,Mimic,etc

    ignoreInTotal=Plan,Review,Photos,Expenses,HomeAdmin,Paperwork

    timelogDirectory=/Users/hboon/Dropbox/backup/timelog/
So it can figure out the project name from the regex and only include the relevant ones. Then compute a total for each project, for AM/PM, as well as a grand total for the day.

You can see the result in that second gist link.

I think I got the idea from John Carmack's .plan files https://github.com/ESWAT/john-carmack-plan-archive/blob/mast.... My original version back in 2009 only had this:

    11:57 AM - 12:17 PM	Code: Check conversation view problems

    12:19 PM - 12:23 PM	Code: Crash when timeline->avatar->followers->back (not home, probably), probably problem with ContactsPicker
It just evolved from there.