Skip to content

Instantly share code, notes, and snippets.

View gaslitbytech's full-sized avatar

David Micallef gaslitbytech

  • Montage Software
  • based in Melbourne Australia
View GitHub Profile
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
from uuid import uuid4
#from urlparse import urlparse, urljoin
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub OAuth
@gaslitbytech
gaslitbytech / listen_sqla.py
Created August 8, 2017 01:32 — forked from dtheodor/listen_sqla.py
Listen for pg_notify with SQL Alchemy + Psycopg2
import select
import datetime
import psycopg2
import psycopg2.extensions
from sqlalchemy import create_engine, text
engine = create_engine("postgresql+psycopg2://vagrant@/postgres")