Skip to content

Instantly share code, notes, and snippets.

View WomB0ComB0's full-sized avatar
πŸ˜΅β€πŸ’«
I need an Advil

Mike Odnis WomB0ComB0

πŸ˜΅β€πŸ’«
I need an Advil
View GitHub Profile
@WomB0ComB0
WomB0ComB0 / database.gen.ts
Created March 24, 2025 08:35
database.gen.ts and related files - with AI-generated descriptions
'use server';
import { exec } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import { promisify } from 'node:util';
import { logger } from '@/utils';
import { Redacted } from '@/classes';
const execPromise = promisify(exec);
@WomB0ComB0
WomB0ComB0 / remove-duplicate-packages.ts
Created March 22, 2025 03:38
remove-duplicate-packages.ts and related files - with AI-generated descriptions
import fs from 'node:fs';
import path from 'node:path';
import type { PackageJson } from 'type-fest';
const packageJsonPath = path.join(process.cwd(), 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) as PackageJson;
const dependencies =
packageJson.dependencies ||
@WomB0ComB0
WomB0ComB0 / logger.ts
Created March 5, 2025 02:09
logger.ts and related files - with AI-generated descriptions
/**
* @fileoverview A comprehensive logging utility for both client and server environments.
* Provides structured logging with support for different log levels, colorization,
* and contextual information.
*/
/**
* Determines if the code is running in a server environment
*/
const isServer = typeof window === "undefined";
@WomB0ComB0
WomB0ComB0 / markdown-to-google-docs.ts
Last active March 5, 2025 04:46
markdown-to-google-docs.ts and related files - with AI-generated descriptions
/**
* # Markdown to Google Docs Converter
*
* This module provides functionality to convert Markdown content to Google Docs
* with proper formatting. It handles various Markdown elements like headings,
* lists, bold, italic, links, and code blocks.
*
* ## Features
* - Create Google Docs from Markdown content
* - Apply proper formatting (headings, bold, italic, links, code blocks)
@WomB0ComB0
WomB0ComB0 / gist.ts
Last active March 5, 2025 09:24
gist.ts and related files - with AI-generated descriptions
import * as path from 'path';
import * as fs from 'fs';
import * as readline from 'readline';
/**
* Decorator that automatically instantiates a class when it's defined.
* @param constructor - The class constructor to instantiate
* @returns The original constructor
*/
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T) {
@WomB0ComB0
WomB0ComB0 / google-maps-api.ts
Created March 1, 2025 07:28
Google Maps API implementation in safely-typed TypeScript
/**
* @fileoverview A comprehensive service for interacting with various Google Maps APIs.
* This module provides a unified interface for geocoding, places search, directions,
* distance calculations, and more Google Maps Platform services.
*
* Features:
* - Geocoding: Convert addresses to coordinates and vice versa
* - Places: Search for places, get place details, and autocomplete predictions
* - Directions: Get directions between locations with waypoints and travel modes
* - Distance Matrix: Calculate distances and travel times between multiple origins/destinations
@WomB0ComB0
WomB0ComB0 / fire-crawl-cli.ts
Last active February 28, 2025 06:58
Local CLI for FireCrawl
import FireCrawlApp, { MapParams } from '@mendable/firecrawl-js';
import { Command } from 'commander';
import * as dotenv from 'dotenv';
import fs from 'node:fs';
import path from 'node:path';
import ora from 'ora';
import chalk from 'chalk';
dotenv.config();
@WomB0ComB0
WomB0ComB0 / advanced-web-scraper-template.py
Last active February 26, 2025 09:18
Advanced web scraper template with content segmentation.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=W0611
import json
import logging
import os
import random
import re
import subprocess
@WomB0ComB0
WomB0ComB0 / tech-scraper-agent.py
Last active February 28, 2025 14:39
Generate article/document summarizations with the Google Gemini API
"""
A comprehensive web scraping and content analysis tool that extracts, summarizes, and documents technical articles.
This module provides functionality to:
- Scrape technical content from web pages
- Extract metadata and images
- Generate AI-powered summaries using Google's Gemini model
- Create and update Google Docs with the processed content
The tool uses type hints throughout and follows strict type safety practices.
@WomB0ComB0
WomB0ComB0 / llm-error-handler.ts
Last active February 14, 2025 22:38
Local LLM powered error handler.
import { GoogleGenerativeAI } from '@google/generative-ai';
// Initialize the Google Generative AI client
const genAI = new GoogleGenerativeAI('your-google-api-key'); // Replace with your actual API key
const model = genAI.getGenerativeModel({ model: 'gemini-pro' });
// Example function that might throw an error
function riskyOperation(input: string): string {
if (input.length < 5) {
throw new Error('Input is too short!');