Skip to content

Instantly share code, notes, and snippets.

@duynguyenhoang
Last active February 21, 2023 08:31
Show Gist options
  • Select an option

  • Save duynguyenhoang/f02402337e6e6beb32b2e715b8ea9c38 to your computer and use it in GitHub Desktop.

Select an option

Save duynguyenhoang/f02402337e6e6beb32b2e715b8ea9c38 to your computer and use it in GitHub Desktop.
Stupid simple script to help you learn/take note daily.
#!/bin/bash
# Stupid simple script to help you learn/take note daily.
# Requires https://github.com/charmbracelet/glow to render markdown in terminal
# IMPORTANT: Your learn files location
export LEARN_HOME=$HOME/learn
lhe() {
# Simple help function to list all commands
for i in {1..50}; do echo -n "="; done
echo
echo "Simple CLI app to help you learn something"
for i in {1..50}; do echo -n "="; done
echo
# Add new commands manually here
echo "✔️ lde Learn Deutsch daily"
echo
echo "✔️ lde Learn Deutsch, practice yesterday note"
echo
echo "✔️ lded Learn Deutsch by date. \nExample: lded 2023-02-20"
echo
echo "✔️ ldet Learn Deutsch by topic. \nExample: ldet dativ"
echo
echo "✔️ len Learn English daily"
echo
echo "✔️ leny Learn English, practice yesterday note"
echo
for i in {1..50}; do echo -n "="; done
}
lded() {
# Learn by date: lded 2023-02-20
glow $LEARN_HOME/de/topics/$1.md
}
ldet() {
# Learn by topic: ldet dativ
glow $LEARN_HOME/de/topics/$1.md
}
# Create or learn today stuff
alias lde="touch $LEARN_HOME/de/daily/$(date +'%Y-%m-%d').md && glow $LEARN_HOME/de/daily/$(date +'%Y-%m-%d').md"
alias ldey="glow $LEARN_HOME/de/daily/$(date -v -1d +'%Y-%m-%d').md"
alias len="touch $LEARN_HOME/en/$(date +'%Y-%m-%d').md && glow $LEARN_HOME/en/$(date +'%Y-%m-%d').md"
alias leny="glow $LEARN_HOME/en/$(date -v -1d +'%Y-%m-%d').md"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment