pip install pytest pydantic
pytest
| #!/bin/zsh | |
| set -euxo pipefail | |
| for service in messaging-py | |
| do | |
| ( | |
| cd $service | |
| git clean -fd . | |
| mkdir $service | |
| mv .* * $service || true |
I hereby claim:
To claim this, I am signing this object:
| ''' | |
| Extends a dict object A with the properties of a dict object B. | |
| @param a: dict object | |
| @param b: dict object | |
| ''' | |
| def extends(a, b): | |
| for key in b: | |
| if key in a: | |
| if isinstance(a[key], dict) and isinstance(b[key], dict): | |
| a[key] = extends(a[key], b[key]) |
| color wombat | |
| hi ColorColumn ctermbg=lightgrey guibg=#474747 | |
| " Cursor shape | |
| hi Cursor guibg=orange guifg=white | |
| set autoindent | |
| set smartindent | |
| set tabstop=4 |
| { | |
| "timestamp": 1405631393.186916, | |
| "user": { | |
| "uid": "1234", | |
| "first_name": "John", | |
| "last_name": "Doe", | |
| "email": "[email protected]" | |
| }, | |
| "transaction": { | |
| "id": "123-345-678" |
| import hmac | |
| import hashlib | |
| import simplejson | |
| from time import time | |
| data = { | |
| 'timestamp': time(), | |
| 'user': { | |
| 'uid': 1234 | |
| } |
| PT.api.call('/bronto/referral', { | |
| method: 'post', | |
| data: { | |
| message: 'Example of message', | |
| emails: ['[email protected]', '[email protected]'] | |
| // OR emails: '[email protected],[email protected]' | |
| }, | |
| success: function (response) { | |
| console.log('OK'); | |
| }, |
| data = ['a', 'b', 'c'] | |
| # Python v2.7 | |
| my_dict = {key: i for i, key in enumerate(data)} | |
| # Python v2.6 | |
| my_dict = dict((key, i) for i, key in enumerate(data)) |