Skip to content

Instantly share code, notes, and snippets.

from openai import OpenAI
import csv
import os
import time
import json
from typing import Dict, Any
# docker run --pull=always -p 8080:8080 ghcr.io/edgelesssys/privatemode/privatemode-proxy:latest
# PRIVATEMODE_API_KEY=<> uv run --with openai function_call.py
// docker run --pull=always -p 8080:8080 ghcr.io/edgelesssys/privatemode/privatemode-proxy:latest --apiKey <KEY>
// bun install @ai-sdk/openai-compatible ai zod
// bun run structured-image-output.js
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
import { generateObject } from 'ai';
import { z } from 'zod';
import fs from 'fs';
import path from 'path';
const config = {
from openai import OpenAI
import base64
import os
import time
# docker run --pull=always -p 8080:8080 ghcr.io/edgelesssys/privatemode/privatemode-proxy:latest
# PRIVATEMODE_API_KEY=<> uv run --with openai gemma-vision.py
api_key = os.environ.get("PRIVATEMODE_API_KEY") # insert
api_base = "http://localhost:8080/v1"
@elchead
elchead / resume.json
Last active March 31, 2024 12:38
Resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Adrian Stobbe",
"label": "Software craftsman with expertise in Kubernetes and distributed systems using Go and Rust",
"image": "",
"email": "[email protected]",
"phone": "",
"url": "https://adrianstobbe.com/projects",
"summary": "I'm an aspiring software craftsman. I appreciate clean code and TDD and have experience with full-stack, but specifically backend development.\nAt work, I gained lots of experience with Kubernetes in the last 1.5 years and am interested in Cloud Computing. \nI'm proficient in Golang, Python, JavaScript (TS), C++ and learning Rust at the moment.",
@elchead
elchead / matcher.go
Created March 7, 2023 08:04
Equality matcher for Gomega
// source: https://github.com/golang/mock/issues/616#issuecomment-1049275800
// see the differences between expected and wanted object in a nice format
type eqMatcher struct {
want interface{}
}
func EqMatcher(want interface{}) eqMatcher {
return eqMatcher{
want: want,
}
@elchead
elchead / cmds.sh
Created January 2, 2023 12:08
linux commands
compgen -c # list commands
@elchead
elchead / .bashrc
Created December 5, 2022 09:26
Consistent bash history across sessions
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
# shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
#export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
HISTCONTROL=ignorespace:ignoredups
@elchead
elchead / coverage.sh
Created July 3, 2022 05:31
Go test coverage
# go get golang.org/x/tools/cmd/cover
# in Go 1.19 go build -cover ?
go test -coverprofile=coverage.out ./... ; go tool cover -html=coverage.out
git tag v1.x # on branch
git push --tags
gh release create --target v1.x
@elchead
elchead / schedule.sh
Last active April 28, 2022 09:07
Schedule later execution mac
echo "./script.sh" | at now + "5 minutes"
# Execute commands from a given file next Tuesday:
at -f path/to/file 9:30 PM Tue
# Check queue
atq
# Remove job from queue
at -r ${JOB_ID}
# Cat the jobs listed on the command line to standard output
at -c ${JOB_ID}