Skip to content

Instantly share code, notes, and snippets.

View peterj's full-sized avatar
🌟
....

Peter Jausovec peterj

🌟
....
View GitHub Profile
@peterj
peterj / create_structure.py
Last active November 26, 2024 21:12
Script for creating directory and file structures from a tree-like text representation
import os
import sys
def get_depth(line):
"""Calculate depth based on indentation and tree characters"""
line_content = line.replace('│', ' ') # Replace vertical lines with spaces
indent = len(line_content) - len(line_content.lstrip())
return indent // 4 if indent > 0 else 0
def clean_path_part(line):
import chromadb
from chromadb.config import Settings
from fastapi import APIRouter
import pinecone
import os
router = APIRouter()
@peterj
peterj / statefulset.
Created February 23, 2024 16:24
stateful set stuff
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: httpbin-statefulset
spec:
serviceName: httpbin
replicas: 1
selector:
matchLabels:
app: httpbin
@peterj
peterj / docker.svg
Created October 20, 2023 17:15
docker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import argparse
import os
import sys
import modules.safe
script_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
models_path = os.path.join(script_path, "models")
sys.path.insert(0, script_path)
# search for directory of stable diffusion in following places
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: helloworld
spec:
hosts:
- startcloudnative.com
gateways:
- public-gateway
http:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: public-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: helloworld
spec:
hosts:
- helloworld.mysuperdomain.com
gateways:
- public-gateway
http:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: public-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: helloworld
spec:
hosts:
- '*'
gateways:
- public-gateway
http: