Skip to content

Instantly share code, notes, and snippets.

View knowsuchagency's full-sized avatar
💭
hustlin'

Stephan Fitzpatrick knowsuchagency

💭
hustlin'
View GitHub Profile
@knowsuchagency
knowsuchagency / scratch_256.py
Last active November 3, 2023 23:12
refreshable header issue
from nicegui import ui
@ui.refreshable
def app():
username, set_username = ui.state("")
with ui.header():
with ui.tabs().classes("w-full") as tabs:
@knowsuchagency
knowsuchagency / markdown.md
Created May 15, 2023 14:11
textual markdown

Zappa Rocks!

Zappa - Serverless Python

CI Coverage PyPI Slack

@knowsuchagency
knowsuchagency / dags.tf
Created March 14, 2023 20:46
deploy dags terraform configu
provider "aws" {
region = "us-east-1"
}
data "aws_s3_bucket" "dev" {
bucket = "..."
}
# Create a data source for each file in dags folder
data "local_file" "dags" {
@knowsuchagency
knowsuchagency / app.py
Created January 24, 2023 15:51
chalice-spec example
from apispec import APISpec
from chalice import Chalice, BadRequestError, Response
from chalice_spec import PydanticPlugin, ChalicePlugin, Docs, Operation
from pydantic import BaseModel, ValidationError
APP_NAME = "chalice-spec example"
app = Chalice(app_name=APP_NAME)
spec = APISpec(
@knowsuchagency
knowsuchagency / utils.py
Created June 17, 2022 06:18
streamlit login form
import streamlit as st
def login_form():
if not ("username" in st.session_state and "password" in st.session_state):
st.write("## Login")
with st.form("Login"):
@knowsuchagency
knowsuchagency / fetch_eventbridge_schema.py
Created May 12, 2021 19:35
fetch schemas from EventBridge
import json
import shlex
import subprocess as sp
from pprint import pprint
registry = "foo"
schema_name = "bar"
cmd = f"aws schemas describe-schema --registry-name={registry} --schema-name={schema_name}"

Keybase proof

I hereby claim:

  • I am knowsuchagency on github.
  • I am knowsuchagency (https://keybase.io/knowsuchagency) on keybase.
  • I have a public key ASAKuhfVCmbp9CQYo_XqUJbZimqKmucZbnvt8kVnW2iSggo

To claim this, I am signing this object:

@knowsuchagency
knowsuchagency / get_prefixes.py
Last active April 27, 2021 20:06
get aws ip prefix whitelist
import requests
from pprint import pprint
def get_prefixes(region='us-east-2', service='AMAZON'):
resp = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json')
prefixes = resp.json()['prefixes']
if region:
@knowsuchagency
knowsuchagency / marp-test.md
Last active April 26, 2021 20:57
marp test
marp
true

Hello, Marp

How goes it?


Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.