Skip to content

Instantly share code, notes, and snippets.

View bcarroll's full-sized avatar

Brett Carroll bcarroll

  • West Virginia, USA
View GitHub Profile
@bcarroll
bcarroll / ChromeWebDriver.py
Last active April 18, 2024 10:23
Selenium Python - Get HTTP Status Code
"""
Implementation of the Selenium Chrome WebDriver
with HTTP Response data included via the ChromeDriver performance logging capability
https://sites.google.com/a/chromium.org/chromedriver/logging/performance-log
The ChromeWebDriver response attribute(s) contain a dict with information about the response
{
"connectionId": [Integer],
"connectionReused": [Boolean],
"encodedDataLength": [Integer],
@bcarroll
bcarroll / flask_config_from_ini.py
Created January 26, 2019 21:14
Configure Flask app using an INI file (no external modules)
def config_from_ini(app, config_file = None, section='flask'):
"""
Configure Flask from an INI file
Parameters:
app - Flask application instance
config_file - Path to the configuration file (INI format)
section - Section name to load key/values from
"""
if config_file is None:
config_file = os.path.join(os.path.dirname(__file__), '..', 'config.ini')
@bcarroll
bcarroll / SAML_AuthnRequest_encode-decode.pl
Created June 20, 2014 14:09
Subroutines to encode and decode a SAMLRequest (AuthnRequest)
use warnings;
use strict;
use Carp;
use XML::Tidy;
use MIME::Base64 qw(encode_base64 decode_base64);
use URI::Escape qw(uri_escape uri_unescape);
use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError);
use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError);
sub decode_samlAuthnRequest{