Skip to content

Instantly share code, notes, and snippets.

@pyropeter
Last active October 13, 2018 14:10
Show Gist options
  • Save pyropeter/a06a672439b28a73b3ab5e48b4388567 to your computer and use it in GitHub Desktop.
Save pyropeter/a06a672439b28a73b3ab5e48b4388567 to your computer and use it in GitHub Desktop.
My calendar
#!/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"))
#!/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