Skip to content

Instantly share code, notes, and snippets.

View bishopb's full-sized avatar
I may be slow to respond.

Bishop Bettini bishopb

I may be slow to respond.
View GitHub Profile
bishopb / aws-login-with-mfa
Created September 28, 2022 02:07
Simple bash wrapper around the AWS CLI commands necessary to get temporary tokens from AWS STS using an identity with MFA
View aws-login-with-mfa
set -euo pipefail
trap 'echo "Caught SIGINT. Exiting..." >&2; exit 1' INT
chmod 600 "${tmpfile}"
trap 'rm -f "${tmpfile}"' EXIT
bishopb /
Created January 7, 2021 18:11
Show all AWS actions, resources, and conditions known to AWS Policy Generator

Looking for a structured list of AWS actions, resources, and conditions? Tired of hunting through the AWS Documentation?

Then just use this simple script.

For example: '.serviceMap["AWS Accounts"]'
* App.js
* creates the Logi global variable
* starts loading the application's initial client side files
* kicks off the Angular bootstrap
* Table of Contents
* 1. Create the Logi global variable
bishopb / contents-kind-distribution
Created April 26, 2019 05:12
Number Format Separator Drill
View contents-kind-distribution
contents_kind count notes
test 86692 *Test.php, */{examples,tests}/*
code 256551
data 2359458 *json.php, */{data,fonts,charset}/*
View CurlCookieJar.php
* Simple class to parse the contents of a cookie jar file created by the cURL extension.
* <code>
* $jar = new CurlCookieJar('/tmp/curl-cookies');
* foreach ($jar->getAllCookies() as $cookie) {
* if ($cookie->expires < time()) {
* echo "Cookie named {$cookie->name} has expired\n";
bishopb / FluentRouter.php
Created September 21, 2016 13:52
Fluent Router in PHP
View FluentRouter.php
class FluentRouter
const DEADEND_RETRY = 2;
public function __construct(array $callbacks = [], $deadend = null)