Skip to content

Instantly share code, notes, and snippets.

# nevertrendbot.py | [email protected]
#
# Why don't pictures like this ever trend?
#
# [X] randomly choose premise for image
# [X] generate image
# [X] post image
import os, configparser, random, csv, tweepy
import pandas as pd
@jeffehobbs
jeffehobbs / venue.py
Last active March 1, 2025 23:47
venue event scraper: watches events sites and reports new events
# venue.py | [email protected]
#
# watches events sites and reports new events
#
# [X] get list of sitemaps
# [X] parse sitemaps
# [X] get existing data from sqlite db
# [X] compare listings to existing data from sqlite
# [X] save data in sqlite db
# [X] make list of new pages
@jeffehobbs
jeffehobbs / goat2meeting.py
Last active August 2, 2024 20:32
Goat2Meeting -- waste the caller's time via Twilio API
# goat2meeting.py | [email protected]
# waste the caller's time
import os, configparser
from flask import Flask
from twilio.twiml.voice_response import VoiceResponse
from openai import OpenAI
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
config = configparser.ConfigParser()
@jeffehobbs
jeffehobbs / owl.py
Created June 19, 2024 02:04
image upload and detection flask app
# owl.py | [email protected]
#
# GOAL: upload a PDF, convert it to an image, and perform OpenAI vision capabilities on the image
#
# TO DO:
# 1. [X] upload PDF or image
# 2. [X] change PDF to image
# 3. [X] upload default prompt
# 4. [X] perform vision API call
# 5. [X] splat response back to client
@jeffehobbs
jeffehobbs / rando.py
Last active June 14, 2024 10:29
a code sample to demonstrate random sampling to estimate large numbers
# rando | [email protected]
#
# a code sample to demonstrate random sampling to estimate large numbers
import random
# globals
LARGE_NUMBER = 1000000
CHANCE = 20 # as in "1 in 20"
@jeffehobbs
jeffehobbs / escalator_music.py
Last active June 12, 2024 18:13
Ollama creates the prompt, Stable Audio renders music based on the prompt. wash rinse repeat
import ollama
import hashlib
from pydub import AudioSegment
import torch
import torchaudio
from einops import rearrange
from stable_audio_tools import get_pretrained_model
from stable_audio_tools.inference.generation import generate_diffusion_cond
@jeffehobbs
jeffehobbs / mississippi.json
Created March 13, 2024 13:35
List of cities and towns of Mississippi
[
"Abbeville",
"Aberdeen",
"Ackerman",
"Algoma",
"Alligator",
"Amory",
"Anguilla",
"Arcola",
"Artesia",
@jeffehobbs
jeffehobbs / texas.json
Created March 13, 2024 13:33
List of municipalities in Texas
[
"Abbott",
"Abernathy",
"Abilene",
"Ackerly",
"Addison",
"Adrian",
"Agua Dulce",
"Alamo",
"Alamo Heights",
@jeffehobbs
jeffehobbs / dallewood.py
Created November 22, 2023 23:25
bulk generator of terrible AI images
# dallewood | [email protected]
import typer, configparser, os, shutil, requests, hashlib, openai
from tqdm import tqdm
app = typer.Typer()
OUTPUT_DIR = '/output'
OUTPUT_PROMPT_PREFIX = ''
# generate image from post text
@jeffehobbs
jeffehobbs / ariseCthulhuBot.py
Last active September 9, 2023 13:00
ariseCthulhuBot - using ML to summon The Old Ones
# ariseCthulhuBot.py | [email protected]
# taking the Great Tweets and sending them through the
# Lovecraftian-chaotic wheat thresher of the "bark" TTS library
# in order to summon The Old Ones
#
# to-do:
#
# 1. [X] get a CLASSIC tweet
# 2. [X] make a music intro
# 3. [X] make a text tweet