Skip to content

Instantly share code, notes, and snippets.

View Turbiani's full-sized avatar
🎯
Focusing

Leonardo Turbiani Turbiani

🎯
Focusing
View GitHub Profile
@agutoli
agutoli / cache.py
Last active February 6, 2020 14:54
python, cache, decorator
def cache(func):
attr = '_cls_cache_'
def wrapper(*args, **kwargs):
cls = args[0]
key = str(args[1:]) + str(kwargs)
if not hasattr(cls, attr):
setattr(cls, attr, {})
_cache = getattr(cls, attr)
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API