Skip to content

Instantly share code, notes, and snippets.

@otsuarez
Created March 31, 2021 19:27
Show Gist options
  • Save otsuarez/400dc7bec7cb5345c4361d052ec137fb to your computer and use it in GitHub Desktop.
Save otsuarez/400dc7bec7cb5345c4361d052ec137fb to your computer and use it in GitHub Desktop.
keeping notes
WEEK := "$(shell date +%Y)/$(shell date +%m)"
all: help
check: ## check connection
@ssh -T git@github.com
save: ## commit and push
git add . ; git commit -am'update docs' ; git pull ; git push
tmux: ## run tmux session
tmux new-session "echo 'watch';make watch" \; split-window -v \; attach
update: ## update from remote
git fetch origin master; git rebase origin/master
watch: ## watch and save
@watch -n 300 make save
week: ## create week doc
@mkdir -p $(WEEK)
@# 2019/09/wo-2019-w39.md
@touch "$(shell date +%Y)/$(shell date +%m)/wo-$(shell date +%Y)-w$(shell date +%V).md"
@echo "$(shell date +%Y)/$(shell date +%m)/wo-$(shell date +%Y)-w$(shell date +%V).md"
@open "$(shell date +%Y)/$(shell date +%m)/wo-$(shell date +%Y)-w$(shell date +%V).md"
today: ## create today's folder
mkdir -p $(shell date +%Y/%m/%V/%d)
touch $(shell date +%Y/%m/%V/%d)/$(shell date +%H%M)-start.md
info: ## show info
@echo "today: $(shell date +%Y/%m/%V/%d)"
@echo "week: $(shell date +%Y)/$(shell date +%m)/wo-$(shell date +%Y)-w$(shell date +%V).md"
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment