Skip to content

Instantly share code, notes, and snippets.

View saschpe's full-sized avatar

Sascha Peilicke saschpe

View GitHub Profile
@saschpe
saschpe / otp.py
Last active January 16, 2020 06:33
Implementation of the OTP algorithm described at http://motp.sourceforge.net in Python. Supports reading secret and PIN from the command-line or from a config file. Allows to paste the generated token to the system's clipboard directly.
#!/usr/bin/env python3
#
# Copyright 2019 Sascha Peilicke <sascha@peilicke.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@coffeemug
coffeemug / gist:6168031
Last active February 3, 2022 23:16
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.