This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import json | |
class DistributedTransaction(object): | |
TTL = datetime.timedelta(seconds=30) | |
def __init__(self, cache, key): | |
self.cache = cache | |
self.key = key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am yoshrote on github. | |
* I am yoshrote (https://keybase.io/yoshrote) on keybase. | |
* I have a public key ASAIb4dui-Tk_RaOmz7id3gR5UamEz1_xfg2FiWJLFcftAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a parser which will parse a string into key-value pairs | |
# it respects quotes around values and coerces the values to expected types using a spec | |
# example at the bottom | |
require 'strscan' | |
class Parser | |
# Parse key-value pairs while respecting quotes and coercing values | |
def parse_by_spec(spec, raw_arguments) | |
processed_args = {} |