Skip to content

Instantly share code, notes, and snippets.

Avatar
🇫🇷
In Nantes

Arthur Rio arthurio

🇫🇷
In Nantes
  • Minerva Project, Inc
  • San Francisco
View GitHub Profile
@arthurio
arthurio / keybase.md
Created May 8, 2020
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am arthurio on github.
  • I am arthurio (https://keybase.io/arthurio) on keybase.
  • I have a public key ASCZuOqRvACWx0X4La-bIjFrt8FaUubXhRsM_zfRwpfGWAo

To claim this, I am signing this object:

@arthurio
arthurio / Extends
Created Apr 6, 2015
Python function to merge 2 dicts, similar to what angular does
View Extends
'''
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])
View .vimrc.after
color wombat
hi ColorColumn ctermbg=lightgrey guibg=#474747
" Cursor shape
hi Cursor guibg=orange guifg=white
set autoindent
set smartindent
set tabstop=4
@arthurio
arthurio / sample.json
Created Jul 17, 2014
Sample data for Purchase webhook
View sample.json
{
"timestamp": 1405631393.186916,
"user": {
"uid": "1234",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"transaction": {
"id": "123-345-678"
@arthurio
arthurio / sign.py
Last active Aug 29, 2015
Webhook Signature Example
View sign.py
import hmac
import hashlib
import simplejson
from time import time
data = {
'timestamp': time(),
'user': {
'uid': 1234
}
@arthurio
arthurio / Bronto referral
Last active Aug 29, 2015
Javascript snippet to call the Bronto referral API
View Bronto referral
PT.api.call('/bronto/referral', {
method: 'post',
data: {
message: 'Example of message',
emails: ['example1@punchtab.com', 'example2@punchtab.com']
// OR emails: 'example1@punchtab.com,example2@punchtab.com'
},
success: function (response) {
console.log('OK');
},
@arthurio
arthurio / build_dict.py
Created Mar 11, 2014
Build a dict in python - 2.6 syntax vs. 2.7
View build_dict.py
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))
You can’t perform that action at this time.