Skip to content

Instantly share code, notes, and snippets.

View brianrusso's full-sized avatar

Brian Russo brianrusso

  • Tampa, FL
View GitHub Profile
import json
import geojson
import requests
class ClavinClient(object):
def __init__(self, clavin_endpoint=None):
if clavin_endpoint is None:
#self.clavin_endpoint = "http://54.186.35.170:9090/api/v0/geotag"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from dogpile.cache import make_region
# key dictionary
keys = dict()
def my_key_generator(namespace, fn, **kwargs):
fname = fn.__name__
def generate_key(*arg):
@brianrusso
brianrusso / auth_sharepointonline.py
Last active May 3, 2022 13:24
Quick and dirty example of how to authenticate to Office 365 SharePoint Online using urllib2, jinja2, cookielib. Basically you POST your user/pass to Microsoft's token service, then hand that token to SharePoint's login proper, which gives you a cookie to access SharePoint content.
import urllib2
import cookielib
import urlparse
import jinja2
from urllib2 import HTTPCookieProcessor
from lxml import etree
# Setup Jinja for SAML
JINJA_TEMPLATE_PATH = "/Users/Brian/IdeaProjects/yggdrasil/templates"
JINJA_ENVIRONMENT = jinja2.Environment(