`today`

a shell function

Put this in your .zshrc

# print a path to a directory for today's work
todaydir()
{
    DAYDIR=~/$(date +%F | sed 's#-#/#g')/
    mkdir -p $DAYDIR
    echo $DAYDIR
}

# go there
today()
{
    echo "    type \`popd\` to go back to $(pwd)"
    pushd $(todaydir)
}

(or use home manager to configure it as a zsh plugin)

A Place to be Messy

Whenever you have a mess to make, just type today and it will take you to a directory like /home/matt/2023/02/07 . Make your mess there. When you're done, popd will take you back.

Let's see the messes that I've made on my work laptop:

❯ tree -L 3
.
├── 2021
│   ├── 04
│   │   ├── 27
│   │   └── 29
│   ├── 05
│   │   ├── 14
...
├── 2023
│   ├── 01
│   │   ├── 01
│   │   ├── 03
│   │   ├── 05
...
    │   ├── 19
    │   └── 24
    └── 02
        ├── 03
        └── 07

I got this laptop in April of 2021. I've made at least 309 messes since then. Most can be safely forgotten. But sometimes...

A grepable Place to be Messy

...sometimes somebody will say:

Hey, what was that one Airflow config we discovered? Something about concurrency?

And you can respond:

❯ find . -name Dockerfile  -exec egrep 'AIRFLOW__.*CONCURRENCY' {} \; -exec dirname {} \;
    ENV AIRFLOW__CELERY__WORKER_CONCURRENCY 4
    ./2022/01/24

Ahem... sorry. You can respond:

That was in January of last year, right? Was it AIRFLOW__CELERY__WORKER_CONCURRENCY ?

...and nobody has to know that you can hardly remember what they're talking about.

Unless you blog about it. Oops.