Skip to content

Instantly share code, notes, and snippets.

View StephenBrown2's full-sized avatar

Stephen Brown II StephenBrown2

  • JumpCloud
  • San Antonio, TX
View GitHub Profile
@StephenBrown2
StephenBrown2 / simple_txn_struct.go
Last active June 8, 2021 06:33
Simple transaction struct format from json
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse and unparse this JSON data, add this code to your project and do:
//
// txns, err := UnmarshalTransactionList(bytes)
// bytes, err = txns.Marshal()
package main
import "encoding/json"
@StephenBrown2
StephenBrown2 / 1_before.jpg
Last active May 17, 2021 20:09
HMBradley Clean Login Page UserScript
1_before.jpg
@StephenBrown2
StephenBrown2 / main.go
Created May 11, 2021 16:27
Find items that exist in multiple places in the os PATH
package main
import (
"fmt"
"os"
"sort"
"strings"
)
func main() {
@StephenBrown2
StephenBrown2 / lp_condition.py
Last active March 5, 2021 20:22
Condition LastPass Export
#!/usr/bin/env python3
import csv
import html
import sys
from pathlib import Path
if len(sys.argv) != 2:
print(f"Usage:\n\t{sys.argv[0]} [lastpass_export.csv]")
sys.exit(1)
@StephenBrown2
StephenBrown2 / throttle_transport.py
Created February 5, 2021 00:09
httpx ThrottleTransport
import time
import datetime
import httpx
class ThrottleTransport(httpx.HTTPTransport):
"""
A custom httpx transport that adds some basic rate-throttling functionality.
Args:
@StephenBrown2
StephenBrown2 / retry.py
Created July 9, 2019 17:02
Typed urllib3.util.retry.Retry
from collections import namedtuple
from typing import Iterable, Optional, Tuple, TypeVar
import urllib3
RequestHistory = namedtuple(
"RequestHistory", ["method", "url", "error", "status", "redirect_location"]
)
RetryType = TypeVar("RetryType", bound="Retry")
@StephenBrown2
StephenBrown2 / README.md
Created August 28, 2018 21:09 — forked from santiagobasulto/README.md
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@StephenBrown2
StephenBrown2 / README.md
Created August 28, 2018 21:09 — forked from santiagobasulto/README.md
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@StephenBrown2
StephenBrown2 / random-placeholder.py
Last active August 11, 2020 20:11
Random placeholder generator - python 3.6+
import random
placeholders = [
{'scheme': 'http', 'domain': 'placebeard.it', 'sep': '/'},
{'scheme': 'http', 'domain': 'placeskull.com', 'sep': '/'},
{'scheme': 'https', 'domain': 'dummyimage.com', 'sep': 'x'},
{'scheme': 'https', 'domain': 'placebear.com', 'sep': '/'},
{'scheme': 'https', 'domain': 'placekitten.com', 'sep': '/'}
]
@StephenBrown2
StephenBrown2 / playbook.yml
Last active December 20, 2017 14:53
rs-playbook
---
- hosts: all
vars_prompt:
- name: user_name
prompt: "What is your real name?"
private: no
- name: user_phone
prompt: "What is your Rackspace phone number?"
private: no
- name: default_dc