Skip to content

Instantly share code, notes, and snippets.

View farazdagi's full-sized avatar

Victor Farazdagi farazdagi

View GitHub Profile
@farazdagi
farazdagi / gist:b60972f006fb272c2fc8
Last active September 12, 2015 12:07 — forked from siddarth/gist:6241382
Stripe FX: Getting the converted amount from the BalanceTransaction

Creating a USD charge on a GBP account:

$ curl https://api.stripe.com/v1/charges \
    -u REDACTED: \
    -d amount=400 \
    -d currency=usd \
    -d card[number]=4242424242424242 \
    -d card[exp_month]=04 \
    -d card[exp_year]=16 \

-d card[cvv]=390 \

@farazdagi
farazdagi / gist:1073753
Created July 9, 2011 17:02
paginator compatible with pymongo and mongoengine
# pagination.py
class Paginator(object):
def __init__(self, query, per_page):
"""Initialize a paginator.
Arguments:
- query -- queryset from pymongo or mongoengine
- per_page -- number of items per page