Re:Ask HN: Small scripts, hacks and automations you're proud...
by inconceivable on Monday March 13, 2023 @12:58AM
(#35131286)
here's my pull request
$ cat << EOF > ~/.bash_profile
> alias lstd='ls ~/Dropbox/todo'
> EOF
Re:Ask HN: Small scripts, hacks and automations you're proud...
by throwaway019254 on Monday March 13, 2023 @09:34AM
(#35135496)
And maybe some autocompletion if using zsh?
#compdef todo
_todo() {
_files -W $HOME/Dropbox/todo/
}
_todo "$@"
Re:Ask HN: Small scripts, hacks and automations you're proud...
by EFreethought on Monday March 13, 2023 @01:23AM
(#35131448)
I use Org mode in Emacs, so I have a follow up:
Do you have a format in your text files to track when things are done, like a checklist?
In Org, you can give things states like "TODO", "INPROGRESS", "DONE", "CANCELLED", add checkboxes (like "[ ]" and "[x]"), have sub-tasks/lists, etc.
I have really gotten into Org, and I have found there are a few other checklist formats/programs in plain text. Just wondering how you do it.
Re:Ask HN: Small scripts, hacks and automations you're proud...
by EVa5I7bHFq9mnYK on Monday March 13, 2023 @04:39AM
(#35132801)
I just have a Dropbox/todo.txt file opened permanently in Notepad++, no scripts and no need to type anything.
Re:Ask HN: Small scripts, hacks and automations you're proud...
by gglitch on Monday March 13, 2023 @04:06PM
(#35141714)
Similar. I've ended up at these functions in .bashrc:
# Append a timestamped entry to the journal
log() {
printf "$(date +%Y-%m-%d--%H:%M) %s\n" "$*" >> $journal
}
# Query the journal
lquery() {
grep -ni $1 $journal
}
# Show all journal entries from today
ltoday() {
clear
grep -n $(date +%Y-%m-%d) $journal
}
# On a line identified by line number, switch @todo to @done
ldo() {
sed -i "$1 s/@todo/@done/" $journal
sed -i "$1 s/$/ \[COMPLETED $(date +%Y-%m-%d--%H:%M)\]/" $journal
}
Nice things about this system: there's only one file; I'm only ever looking at the data I want to see; and there are no applications running or files open (except my terminal, I guess).
While, whenever I have a new project/etc come up, I can just
And get a new, nice clean file, with the same backups and multi-device accessibility.