Created
March 31, 2021 19:27
-
-
Save otsuarez/400dc7bec7cb5345c4361d052ec137fb to your computer and use it in GitHub Desktop.
keeping notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WEEK := "$(shell date +%Y)/$(shell date +%m)" | |
all: help | |
check: ## check connection | |
@ssh -T [email protected] | |
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