{"id":816,"date":"2018-07-19T03:22:48","date_gmt":"2018-07-19T03:22:48","guid":{"rendered":"https:\/\/www.crccheck.com\/blog\/?p=816"},"modified":"2022-02-10T15:16:39","modified_gmt":"2022-02-10T15:16:39","slug":"my-did-to-help-me-remember-what-i-did","status":"publish","type":"post","link":"https:\/\/www.crccheck.com\/blog\/my-did-to-help-me-remember-what-i-did\/","title":{"rendered":"My did to help me remember what I did"},"content":{"rendered":"<p>This article was making the rounds this week: <a href=\"https:\/\/theptrk.com\/2018\/07\/11\/did-txt-file\/\">did.txt file<\/a>. Lately, I&#8217;ve been having trouble remember what I did, so the timing of that post was perfect.<\/p>\n<p>In the past, I&#8217;ve been able to do this in git like <code>git reflog --since yesterday --decorate --author $(git whoami)<\/code>, but these days I&#8217;m in many Git repos and a lot of my work isn&#8217;t code, so the `did.txt` solution looked great. But following my slogan, &#8220;do the same thing you&#8217;ve already done, unless you can do it lazier&#8221;, I came up with an even lazier method. In my dotfiles, I have this bash function:<\/p>\n<pre><code># Inspired by https:\/\/theptrk.com\/2018\/07\/11\/did-txt-file\/\ndid () {\n mkdir -p ~\/Documents\/did\n if [ -n \"$*\" ]; then\n   touch ~\/Documents\/did\/\"$*\";\n fi\n\u00a0find ~\/Documents\/did -type f -printf \"%TY-%Tm-%Td %TH:%TM\\t%P\\n\" | sort -nr | head -n 10\n}<\/code><\/pre>\n<p>You use it like:<\/p>\n<pre><code>$ did Printed my TPS report<\/code><\/pre>\n<pre><code>$ did Re-printed my TPS report with the new cover sheet<\/code><\/pre>\n<p>And you use the same command with no arguments to get what you did:<\/p>\n<pre><code>$ did\n2018-07-18 10:59 Re-printed my TPS report with the new cover sheet\n2018-07-18 10:27 Printed my TPS report<\/code><\/pre>\n<h2>Shortcomings<\/h2>\n<p>You have to be careful what you type. For example, in &#8220;did 10\/10 tasks&#8221;, the &#8220;\/&#8221; gets treated as a directory separator instead of a forward slash. There are ways around this but I haven&#8217;t found one I like yet.<\/p>\n<p>Eventually, I&#8217;ll have to clean out my ~\/Documents\/did, but that&#8217;s just deleting old files. It&#8217;ll be fun to relive what I was doing. If it actually becomes a problem, it can be automated too.<\/p>\n<p>A duplicate update erases the earlier entry. In real life, this won&#8217;t happen much, and if it does, I don&#8217;t care. I see this as a feature.<\/p>\n<h3>Mac\/OSX users<\/h3>\n<p><code>find<\/code> on OSX doesn&#8217;t have <code>-printf<\/code>, so you&#8217;ll need <code>brew install findutils<\/code>. I recommend just running it like <code>brew install findutils --with-default-names<\/code> so <code>find<\/code> just works the way you expect it to.<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article was making the rounds this week: did.txt file. Lately, I&#8217;ve been having trouble remember what I did, so the timing of that post was perfect. In the past, I&#8217;ve been able to do this in git like git reflog &#8211;since yesterday &#8211;decorate &#8211;author $(git whoami), but these days I&#8217;m in many Git repos&hellip;<\/p>\n <a href=\"https:\/\/www.crccheck.com\/blog\/my-did-to-help-me-remember-what-i-did\/\" title=\"My did to help me remember what I did\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">My did to help me remember what I did<\/span><\/a>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[47,1],"tags":[35],"class_list":["entry","author-showmewhatyougot","post-816","post","type-post","status-publish","format-standard","category-meh-practices","category-uncategorized","tag-bash"],"_links":{"self":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/comments?post=816"}],"version-history":[{"count":5,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/816\/revisions"}],"predecessor-version":[{"id":926,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/816\/revisions\/926"}],"wp:attachment":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/media?parent=816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/categories?post=816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/tags?post=816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}