Skip to content

Instantly share code, notes, and snippets.

View czekan's full-sized avatar

Tomasz Czekański czekan

  • Kraków, Poland
View GitHub Profile
### Keybase proof
I hereby claim:
* I am czekan on github.
* I am czekan (https://keybase.io/czekan) on keybase.
* I have a public key ASBQzlQhS10zqxfw-ZBRfNDo7WvFhVU4KnTaTshhh9ps1wo
To claim this, I am signing this object:
# Activate virtualenv or show current virtualenv
ve() {
if [ -n "$VIRTUAL_ENV" ]; then
local venv="$(basename $VIRTUAL_ENV)"
if [ -n "$venv" ]; then
echo "($venv) $VIRTUAL_ENV"
fi
else
source env/bin/activate
echo "::: current virtualenv: $VIRTUAL_ENV"
@czekan
czekan / PayPal IPN verification, Flask, Python
Last active December 24, 2015 16:09
PayPal IPN message verification. Example is in Flask, but it should be easy to move it to other framework. It is encoding proof :), so when paypal send you a message with encoded characters it will handle it smoothly. If you want to move it to different framework remember that 'request.data' is a string in Flask not a unicode.
import urllib
import urlparse
from flask import request
from your_app import app
# set it to True in production mode
app.config['PAYPAL_LIVE'] = False