Skip to content

Instantly share code, notes, and snippets.

View mstrYoda's full-sized avatar
🎧
Developing platform infrastructure. Microservices, CNCF, Go, Kubernetes <3

Emre Savcı mstrYoda

🎧
Developing platform infrastructure. Microservices, CNCF, Go, Kubernetes <3
View GitHub Profile
@mstrYoda
mstrYoda / llm-proxy.go
Created September 17, 2025 12:49
An example http handler and proxy for mobile applications to protect their LLM keys.
package main
import (
"bytes"
"flag"
"io"
"log"
"net/http"
"net/url"
"time"
@mstrYoda
mstrYoda / main.py
Created February 28, 2025 08:49
ai agent poc with agno (phidata)
from agno.agent import Agent, AgentMemory
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.file import FileTools
from agno.memory.db.sqlite import SqliteMemoryDb
from agno.memory.summarizer import MemorySummarizer
from agno.memory.classifier import MemoryClassifier
from agno.storage.agent.sqlite import SqliteAgentStorage
gemini_model = Gemini(id="gemini-2.0-flash-exp", api_key="")
package main
import (
"fmt"
"net"
"os"
"sync"
"time"
)
package main
import (
"fmt"
"net"
"os"
"time"
)
func main() {
package main
import (
"fmt"
"net"
"os"
)
func main() {
listen, err := net.Listen("tcp", "127.0.0.1:8080")
package main
import (
"fmt"
"net"
"net/http"
)
type myHandler struct {
}
package main
import (
"context"
"fmt"
"io"
"net/http"
"net/http/httptrace"
"time"
)
type InMemListener struct {
connCh chan net.Conn
}
func newInMemListener() *InMemListener {
return &InMemListener{
connCh: make(chan net.Conn, 1),
}
}
func TestHttpServer(t *testing.T) {
mux := http.NewServeMux()
mux.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
})
srv := httptest.NewUnstartedServer(mux)
srv.Start()
time.Sleep(1 * time.Second)
func newLocalListener() net.Listener {
if serveFlag != "" {
l, err := net.Listen("tcp", serveFlag)
if err != nil {
panic(fmt.Sprintf("httptest: failed to listen on %v: %v", serveFlag, err))
}
return l
}
l, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {