Skip to content

Instantly share code, notes, and snippets.

View WomB0ComB0's full-sized avatar
🧠
Cogito, ergo sum

Mike Odnis WomB0ComB0

🧠
Cogito, ergo sum
View GitHub Profile
@WomB0ComB0
WomB0ComB0 / bun-shell-case.ts
Created April 23, 2025 02:53
bun-shell-case.ts and related files - with AI-generated descriptions
import { $ } from 'bun';
import { platform as osPlatform } from 'node:os';
// Removed unused 'exec' import
/**
* Enum representing the detected operating system platform.
*/
export enum Platform {
Windows = 'windows',
Mac = 'mac',
@WomB0ComB0
WomB0ComB0 / project-llm.ts
Created April 25, 2025 00:49
project-llm.ts and related files - with AI-generated descriptions
import { argv, write } from 'bun';
import path from 'node:path';
import { Logger } from './logger.js';
import { GoogleGenAI } from '@google/genai';
/**
* Decorator that automatically instantiates a class when it's defined
*/
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T): T {
new constructor();
@WomB0ComB0
WomB0ComB0 / tech-week.ts
Last active April 30, 2025 00:53
tech-week.ts and related files - with AI-generated descriptions
"use strict";
import { readableStreamToJSON, file } from 'bun';
import { z } from 'zod';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { GoogleMapsService } from './map.js';
import dotenv from 'dotenv';
dotenv.config({ path: '.env' });
@WomB0ComB0
WomB0ComB0 / fire-crawl-parser.ts
Created April 30, 2025 01:55
fire-crawl-parser.ts and related files - with AI-generated descriptions
import { file, readableStreamToJSON, argv, write } from 'bun';
import { z } from 'zod';
const fireSchema = z.object({
markdown: z.string(),
metadata: z.object({
generator: z.string(),
viewport: z.string(),
language: z.string(),
description: z.string(),
@WomB0ComB0
WomB0ComB0 / distance-formulas.ts
Last active February 6, 2026 03:50
distance-formulas.ts and related files - with AI-generated descriptions
/**
* Copyright (c) 2025 Mike Odnis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@WomB0ComB0
WomB0ComB0 / sponsor.ts
Created June 2, 2025 23:43
sponsor.ts and related files - with AI-generated descriptions
import { Octokit } from '@octokit/rest';
import { env, argv } from 'bun';
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T): T {
new constructor();
return constructor;
}
@selfExecute
class Main {
@WomB0ComB0
WomB0ComB0 / webp.py
Last active October 13, 2025 07:19
webp.py and related files - with AI-generated descriptions
#!/usr/bin/env python3
import os
import subprocess
from pathlib import Path
from concurrent.futures import Future, ThreadPoolExecutor, as_completed
from time import perf_counter
import shutil
import logging
from typing import List, Set
@WomB0ComB0
WomB0ComB0 / gitcontent
Created June 22, 2025 06:12
gitcontent and related files - with AI-generated descriptions
#!/usr/bin/env bun
import { $ } from "bun";
// Function to fetch contents from GitHub API
// It now takes a 'depth' and 'currentDepth' for intelligent display and control
async function fetchContents(owner, repo, path = "", options = { maxDepth: Infinity, currentDepth: 0 }) {
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
const indent = " ".repeat(options.currentDepth); // For visual indentation
@WomB0ComB0
WomB0ComB0 / elysia-starter.ts
Last active June 27, 2025 08:23
elysia-starter.ts and related files - with AI-generated descriptions
import { Elysia } from "elysia";
import { cors } from '@elysiajs/cors';
import { serverTiming } from '@elysiajs/server-timing';
import type { SocketAddress } from "bun";
import { rateLimit, DefaultContext, type Generator } from 'elysia-rate-limit';
import { ip } from 'elysia-ip';
const Stringify = (o: object) => JSON.stringify(o, null, 2)
const ipGenerator: Generator<{ ip: SocketAddress }> = (_req, _serv, { ip }) => ip?.address ?? 'unknown'
@WomB0ComB0
WomB0ComB0 / elysia-starter-advanced.ts
Last active June 28, 2025 20:40
elysia-starter-advanced.ts and related files - with AI-generated descriptions
import { Elysia } from "elysia";
import { cors } from '@elysiajs/cors';
import { serverTiming } from '@elysiajs/server-timing';
import type { SocketAddress } from "bun";
import { rateLimit, DefaultContext, type Generator } from 'elysia-rate-limit';
import { ip } from 'elysia-ip';
import { opentelemetry } from '@elysiajs/opentelemetry'
import { record } from '@elysiajs/opentelemetry';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-node'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto'