Skip to content

Instantly share code, notes, and snippets.

@neilsh
neilsh / gist:e5deb434622204e9141b45f67571a55b
Last active June 15, 2023 17:45
GPT4-generated MermaidJS for Flask CRUD app with cache
sequenceDiagram
    participant C as Client
    participant S as Server
    participant R as Redis Cache
    participant DB as Database

    Note over C,S: Create
    C->>S: POST /resource
    S->>DB: db.session.add(resource)
@neilsh
neilsh / clientx.py
Created March 31, 2023 22:31 — forked from gawel/clientx.py
Locust http2 client
# for HTTP/2 support in locust
# https://github.com/locustio/locust/issues/264
# https://gist.github.com/gawel/f48e577425f872e1a81028f3f53353cf#file-clientx-py
# has modifications to support breaking changes from locust 2.15.0
import re
import time
from locust import User
from locust.exception import LocustError
import httpx
def find(key, dictionary):
if isinstance(dictionary, list):
for item in dictionary:
for result in find(key, item):
yield result
elif isinstance(dictionary, dict):
for k, v in dictionary.iteritems():
if k == key:
yield v
for result in find(key, v):