Skip to content

Instantly share code, notes, and snippets.

@maccman
maccman / app.py
Created August 8, 2012 23:30
Stripe Flask Example
import os
from flask import Flask, render_template, request
import stripe
stripe_keys = {
'secret_key': os.environ['SECRET_KEY'],
'publishable_key': os.environ['PUBLISHABLE_KEY']
}
stripe.api_key = stripe_keys['secret_key']
# by fcicq <[email protected]>, 2013.4.7, GPLv2
# Tornado 3.0 is required.
from tornado.websocket import websocket_connect, WebSocketClientConnection
from tornado.ioloop import IOLoop
from datetime import timedelta
#echo_uri = 'ws://echo.websocket.org'
echo_uri = 'ws://ws.blockchain.info/inv'
PING_TIMEOUT = 15
class myws():
@mihkels
mihkels / 1-req.sh
Last active October 24, 2022 19:20
Ubuntu 12.04 with flask + nginx + uwsgi
#!/bin/bash
sudo apt-get update
# Now let's install all the required ubuntu packages
sudo apt-get install build-essential uwsgi nginx uwsgi-plugin-python python-pip
# PS! If you are doing this stuff for fun I do recommend to install nginx from PPA repository
# that you can find here https://launchpad.net/~nginx/+archive/development