Skip to content

Instantly share code, notes, and snippets.

View cyberpunk042's full-sized avatar

Cyberpunk 042 cyberpunk042

View GitHub Profile
@cyberpunk042
cyberpunk042 / axiom_orbits.py
Last active December 21, 2024 12:43
Axiom Orbits is a creative sandbox game where you build and navigate layered orbit-like structures around a single central “O.” Using two perpendicular “axioms,” you populate each layer’s outer ring of cells with characters, creating intricate patterns. You can then visualize your evolving atomic-like model in 3D, experimenting with various fill…
import curses
import logging
import math
import plotly.graph_objects as go
import sys
import random
logging.basicConfig(
filename="layer_axiom_game.log",
filemode="w",
@cyberpunk042
cyberpunk042 / cube.py
Created December 17, 2024 09:12
Cube Game: This interactive text-based game lets you navigate a 3D grid of pages, place characters into each cell, and even generate text with GPT assistance. Rotate your cube, select regions, and craft intricate patterns of text, all while exploring a visually represented matrix in a terminal interface.
import curses
import argparse
import os
import sys
import time
import plotly.graph_objects as go
import matplotlib.pyplot as plt
import logging
import openai
@cyberpunk042
cyberpunk042 / ai_scrape_with_parsera.py
Last active August 16, 2024 22:44
Snippet to scrape a website for targeted elements. The input can be key-value pair or JSON string. The output can be console or file.
import os
import logging
import argparse
from parsera import Parsera
import json
import time
from requests.exceptions import RequestException
# Setup logging
logging.basicConfig(level=logging.INFO)
@cyberpunk042
cyberpunk042 / query_with_tools.py
Last active August 16, 2024 21:51
Snippet to query openai with composio using a prompt and a given list of tools actions. The query can then make calls to the integrated tools.
import os
import logging
import argparse
from openai import OpenAI
from composio_openai import ComposioToolSet, App, Action
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@cyberpunk042
cyberpunk042 / query_with_rag_data.py
Last active August 16, 2024 21:57
Snippet to query haystack-ai using a prompt and a local or remote file. The file can be knowledge, data, resources, context and what you can make sense of.
import os
import logging
import argparse
from haystack import Pipeline, PredefinedPipeline
import urllib.request
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@cyberpunk042
cyberpunk042 / setup_email_service.sh
Last active July 26, 2024 00:58
Docker-Compose setup script - HTTP:5080 to Flask to [Mailhog | Prod Smtp] - The script start up a mailhog container for smtp local testing when option "test" is chosen, or connect directly to the remote smtp service when option "prod" is chosen. A Python Flash app serves as the front, ready to listen on 'http://localhost:5080/send-email'.
#!/bin/bash
# Variables
PROJECT_DIR="email_service"
FLASK_APP_FILE="app.py"
DOCKERFILE="Dockerfile"
REQUIREMENTS_FILE="requirements.txt"
DOCKER_COMPOSE_FILE="docker-compose.yml"
# Default values for testing with MailHog
@cyberpunk042
cyberpunk042 / debian12_configuration_script.sh
Last active January 8, 2025 13:37
TrueNAS Scale 24.04.2 Customization
#!/bin/bash
# Set script to exit on error
set -e
# Enable logging
exec > >(tee -i /var/log/setup-script.log)
exec 2>&1
echo "Starting script execution..."