This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* npm install jsdom | |
* npm install jquery | |
*/ | |
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>"; | |
/* parse the html and create a dom window */ | |
var window = require('jsdom').jsdom(html, null, { | |
// standard options: disable loading other assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from botocore.credentials import RefreshableCredentials | |
from botocore.session import get_session | |
from boto3 import Session | |
def assumed_session(role_arn, session_name, session=None): | |
"""STS Role assume a boto3.Session | |
With automatic credential renewal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Took this: | |
# https://s3.amazonaws.com/awsiammedia/public/sample/SAMLAPICLIADFS/samlapi_formauth_adfs3.py | |
# converted to boto3 and smooshed it together with this: | |
# https://gist.github.com/kapilt/ac8e222081f63ba64e93 | |
# which gave birth too this: | |
import sys | |
import botocore | |
import boto3 | |
import requests |