Skip to content

Instantly share code, notes, and snippets.

View Aayush9029's full-sized avatar
🚢
A bigger ship is harder to steer.

Aayush Aayush9029

🚢
A bigger ship is harder to steer.
View GitHub Profile
@Aayush9029
Aayush9029 / sd-dry.sh
Last active October 26, 2025 01:59
ProtocolZero cleanup scripts
#!/bin/bash
echo "================================================"
echo "ProtocolZero Cleanup Script (DRY RUN)"
echo "================================================"
echo ""
echo "⚠️ WARNING: This will permanently delete all"
echo " ProtocolZero folders from your system!"
echo ""
echo "Searching for ProtocolZero directories in $HOME..."
@Aayush9029
Aayush9029 / NSWindow+Glass.swift
Created June 3, 2025 20:55
NSWindow AppKit that is pretty
let windowStyles: NSWindow.StyleMask = [.titled, .utilityWindow, .hudWindow]
let windowRect = NSRect.init(x: 0, y: 0, width: 600, height: 400)
let window = NSPanel.init(contentRect: windowRect, styleMask: windowStyles, backing: .buffered, defer: true)
window.title = "Title"
window.titleVisibility = .hidden
window.titlebarAppearsTransparent = true
let view = NSView()
window.contentView = view
window.contentView?.wantsLayer = true
window.contentView?.layer?.cornerRadius = 0.0
@Aayush9029
Aayush9029 / llm.py
Created May 7, 2025 22:25
OpenAI LLM.py
from openai import AsyncOpenAI
from typing import Type, TypeVar, Optional
import logging
import os
from pydantic import BaseModel
logger = logging.... for logger
T = TypeVar('T', bound=BaseModel)
@Aayush9029
Aayush9029 / IntervalClient.swift
Last active October 25, 2025 01:42
Local Interval Client
import Dependencies
import Foundation
public struct IntervalKey {
let key: String
let config: IntervalConfig
public init(_ key: String, config: IntervalConfig) {
self.key = "interval." + key
self.config = config
//
// NetworkMonitorClient.swift
// Notto
//
// Created by Aayush Pokharel on 2025-01-09.
//
import Dependencies
import Foundation
import Network
@Aayush9029
Aayush9029 / RetryClient.swift
Last active January 18, 2025 22:50
Network Retry Client
import Dependencies
import Foundation
import os
import XCTestDynamicOverlay
// Add Logger
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "RetryClient", category: "Retry")
public struct RetryClient {
public var retry: @Sendable (RetryConfiguration, @Sendable () async throws -> Void) async -> Void
@Aayush9029
Aayush9029 / gist:e55c38f6fad238ebb4e9094b700b1e7e
Last active December 25, 2024 06:13
Context generator zsh code
We couldn’t find that file to show.
@Aayush9029
Aayush9029 / MetaDataFetcher.swift
Last active January 13, 2024 03:34
Swift URLMeta Data Fetcher
import LinkPresentation
import UIKit
struct LinkMetadata {
let title: String
let image: Data?
let url: URL?
init(_ metadata: LPLinkMetadata, imageData: Data? = nil) {
self.title = metadata.title ?? "Untitled Website"
@Aayush9029
Aayush9029 / AssemblyAI.swift
Created January 8, 2024 17:00
Assembly AI websocket swift
import AVFoundation
import Foundation
import SwiftUI
class AssemblyAIWebSocketClient: ObservableObject {
private var webSocketTask: URLSessionWebSocketTask?
private let urlSession: URLSession
private let apiKey: String = "" // Replace with your actual API key
private let audioSampleRate: Int
@Aayush9029
Aayush9029 / docker-compose.yml
Last active May 13, 2023 01:04
RRR Docker Compose
---
version: "2.1"
services:
radarr:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
environment:
- PUID=1000
- PGID=1000
- TZ=America/Toronto