Skip to content

Instantly share code, notes, and snippets.

View aflansburg's full-sized avatar
🔧

Abe Flansburg aflansburg

🔧
View GitHub Profile
@aflansburg
aflansburg / commands.sh
Created April 24, 2023 19:58
EC2-Helpful-AWS-Commands
# List all provisioned IP addresses for a subnet
aws ec2 describe-network-interfaces \
--filters Name=subnet-id,Values=<subnet id> \
| jq -r '.NetworkInterfaces[].PrivateIpAddress' | sort
@aflansburg
aflansburg / _.sh
Created March 3, 2023 18:43
Basic jq w/ dynamic keys example with kubectl
# want to decode the output of the `kubectl get secret secname` command
# and specifically the `auth` value
# when we maybe don't know the value of the key corresponding to a container registry
# {
# "auths": {
# "https://index.docker.io/v1/": {
# "username": "smittywerbenjagermanjensen",
# "password": "sup3rs3cr3t",
# "email": "swjmjensen12345@example.com",
# "auth": "c21pdHR5d2VyYmVuamFnZXJtYW5qZW5zZW46c3VwM3JzM2NyM3QK"
@aflansburg
aflansburg / keybase.md
Created August 29, 2022 20:01
keybase.md

Keybase proof

I hereby claim:

  • I am aflansburg on github.
  • I am aflansburg (https://keybase.io/aflansburg) on keybase.
  • I have a public key ASDRD9OAl-WrrItDis5f65_Hcj4uVQIz9hP0_8jKRtOz6wo

To claim this, I am signing this object:

@aflansburg
aflansburg / dd_excludes.json
Created April 20, 2022 19:53
Inject `dd-privacy-hidden` tag into specific inputs and inputs with autocomplete attribute
{
"exclusions": [
"email",
"firstName",
"lastName",
"phoneNumber",
"street1",
"street2",
"city",
"state",
@aflansburg
aflansburg / redact.js
Created April 8, 2022 14:53
Simple Redact/Hide/Obscure/Mask text content on page with JS
/* Finds text content in some element and redacts it
with the provided mask value
*/
function redactContent(textValue, tagType, maskValue){
for (const tag of document.querySelectorAll(tagType)) {
if (tag.textContent.includes(textValue)) {
tag.textContent = maskValue;
}}
}
@aflansburg
aflansburg / cyberpunk_vaporwave.itermcolors
Created January 13, 2020 19:52
Vaporwave / Cyberpunk 2077 iTerm Color Theme/Scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.13725490868091583</real>
@aflansburg
aflansburg / imports.py
Created September 15, 2021 14:07
standard_jupyter_notebook_imports
# import initial libs to do EDA
import pandas as pd
import numpy as np
import random
# viz libs
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
%matplotlib inline
@aflansburg
aflansburg / gist:f9a04ee5258b34d4cdd2ab63a6fc327b
Created September 2, 2021 20:52
Cyberpunk 2077 iTerm2 Profile + Colors
{
"Ansi 5 Color" : {
"Red Component" : 0.022819328308105468,
"Color Space" : "sRGB",
"Blue Component" : 0.8666666666666667,
"Alpha Component" : 1,
"Green Component" : 0.83805519318199617
},
"Tags" : [
@aflansburg
aflansburg / extract_runtime.py
Created August 5, 2021 14:46
Check GridSearchCV fit Runtime
# import time - not the abstract construct of 'time'
# but rather a library built into Python for
# dealing with time
from time import time
# ML stuff
ada_tuned_clf = AdaBoostClassifier(random_state=1)
# some canned params for hypertuning
parameters = {
@aflansburg
aflansburg / gridsearch_runtime.py
Last active August 1, 2021 18:52
Calculate GridSearchCV runtime
# runtime info based on solution below and fit_time results of the gridsearchcv return object
# based on a response on StackExchange Data Science - Naveen Vuppula
# https://datascience.stackexchange.com/a/93524/41883
# from time import time
def gridsearch_runtime(grid_obj, X_train, y_train):
'''
Parameters:
grid_obj: GridSearchCV return object that has not yet been fit to training data
X_train: split training data independent variables
y_train: split training data containing dependent variable