Skip to content

Instantly share code, notes, and snippets.

@DarkRedman
DarkRedman / GPLv2
Created November 3, 2016 11:04
License GPLv2
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
@DarkRedman
DarkRedman / timesince.py
Created November 2, 2016 16:27
A standalone version of django timesince
from __future__ import unicode_literals
import calendar, datetime, six
from functools import total_ordering, wraps
class Promise(object):
"""
This is just a base class for the proxy class created in
the closure of the lazy function. It can be used to recognize
promises in code.