Skip to content

Instantly share code, notes, and snippets.

View wqa's full-sized avatar
💭
I may be slow to respond.

Magnus Bodin wqa

💭
I may be slow to respond.
View GitHub Profile
@wqa
wqa / advent.py
Last active November 29, 2022 06:27
from datetime import datetime, timedelta
# utility functions for advent sundays
# calculate a given advent sunday (1-4), optionally for a given year
def advent(**kwargs) -> datetime:
no = min(max(int(kwargs.get('advent', 1)), 1), 4)
year = kwargs.get('year', datetime.now().year)
xmas = datetime(year, 12, 25)
advent_4 = xmas - timedelta(days=xmas.isoweekday())

Keybase proof

I hereby claim:

  • I am wqa on github.
  • I am bodin (https://keybase.io/bodin) on keybase.
  • I have a public key whose fingerprint is 5867 BF43 0FE6 3D96 1E79 0E40 2B60 6B48 6A15 AE42

To claim this, I am signing this object:

@wqa
wqa / gist:87df285011a4cb437b38f13067aed795
Created January 6, 2017 13:49
Verifying that "magnusbodin.id" is my Blockstack ID. https://onename.com/magnusbodin
Verifying that "magnusbodin.id" is my Blockstack ID. https://onename.com/magnusbodin