Last active
October 13, 2018 14:10
-
-
Save pyropeter/a06a672439b28a73b3ab5e48b4388567 to your computer and use it in GitHub Desktop.
My calendar
This file contains hidden or 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
#!/usr/bin/python | |
from datetime import date, timedelta | |
from locale import setlocale, LC_ALL | |
setlocale(LC_ALL, '') | |
start = date.today() - timedelta(7) | |
d = start | |
for i in range(7*5): | |
d = d + timedelta(1) | |
year, week, weekday = d.isocalendar() | |
# a week header needs to be displayed on weekday 1 | |
if weekday == 1: | |
print("\n== %04i KW %02i ==" % (year, week)) | |
# print day, if important: | |
# * monday | |
# * frist day of month | |
if weekday == 1 or d.day == 1: | |
print(d.strftime("%Y-%m-%d %a")) |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
set -u | |
cd ~/leben | |
vim kalender | |
if [ -n "`git status --porcelain kalender`" ]; then | |
git commit -m'edit todo' kalender | |
git push | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment