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
bishopb / FluentRouter.php
Created September 21, 2016 13:52
Fluent Router in PHP
<?php
class FluentRouter
{
const DEADEND_EXCEPTION = 1;
const DEADEND_RETRY = 2;
const DEADEND_BLACKHOLE = 3;
public function __construct(array $callbacks = [], $deadend = null)
{
<?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
bishopb / contents-kind-distribution
Created April 26, 2019 05:12
Number Format Separator Drill
contents_kind count notes
test 86692 *Test.php, */{examples,tests}/*
code 256551
data 2359458 *json.php, */{data,fonts,charset}/*
/**
*
* 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
bishopb / README.md
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:

aws-arc.sh '.serviceMap["AWS Accounts"]'
@bishopb
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
#!/bin/bash
set -euo pipefail
trap 'echo "Caught SIGINT. Exiting..." >&2; exit 1' INT
tmpfile=$(mktemp)
chmod 600 "${tmpfile}"
trap 'rm -f "${tmpfile}"' EXIT