Skip to content

Instantly share code, notes, and snippets.

View plavjanik's full-sized avatar

Petr Plavjaník plavjanik

View GitHub Profile
@plavjanik
plavjanik / 0_reuse_code.js
Created May 20, 2014 12:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@plavjanik
plavjanik / auth_sharepointonline.py
Created June 28, 2016 16:10 — forked from brianrusso/auth_sharepointonline.py
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(