Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 g023’s gists · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

@g023
g023 / ex1.htm
Last active June 19, 2025 01:12
3d Kart Game boilerplate raw examples (rough outs, may not work 100%)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Mini 3D Kart Game</title>
<style>
html, body {
margin: 0;
overflow: hidden;
background: #000;
@g023
g023 / python_fps_movement.py
Last active June 7, 2025 01:29
Basic Python 3D FPS movement (OpenGL)
import glfw
from OpenGL.GL import *
from OpenGL.GLU import *
import math
# pip install glfw PyOpenGL PyOpenGL_accelerate
class FPSCamera:
"""
An FPS-style camera that processes input and calculates the corresponding Euler Angles,
@g023
g023 / glfw_imgui
Created May 29, 2025 04:24
Enhanced File Browser in Python using GLFW and ImGui
"""
Enhanced File Browser using GLFW and ImGui
A modern, intuitive file browser with proper error handling, visual feedback,
navigation with expandable folder tree and content pane.
"""
import os
import sys
import stat
from pathlib import Path
from typing import Dict, Set, Optional, Tuple
@g023
g023 / ocr_ollama.py
Last active May 16, 2025 05:53
OCR with Ollama - Using Local Vision Models to OCR an Image
# Author: https://gist.github.com/g023
# Link for this file: https://gist.github.com/g023/1ec7723745b17fec80f665951bca3d75
# Convert text in an image to a text string.
import requests
import base64
import json
server_url = "http://localhost:11434/api/generate"
model = "qwen2.5vl:7b-q4_K_M"
prompt = "Extract all the text from this image and present it as a single string."
@g023
g023 / manual_webcam_control.py
Created April 21, 2025 05:31
Manual Webcam Control
# Author: g023 - https://gist.github.com/g023
import cv2
import numpy as np
from datetime import datetime
import os
import logging
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
@g023
g023 / think_deep_explorer.py
Last active April 9, 2025 06:29
Ollama chat with a model's thoughts directly and force answer when desired.
# Thinking Deep Explorer - Communicate with Thoughts
# This program is a chat interface for the Ollama server.
# In this chat, you communicate in the model's thoughts, and the model responds with its thought process.
# Answers are forced by requesting "answer: <further answer instructions>" for a generic non-thinking response.
# When in thinking response mode, only the thoughts will be presented.
# Thoughts are passed forward as the conversation continues.
# You can save by typing "save" and load by typing "load".
# You can also clear the conversation by typing "clear"
# Remove the last thought by typing "remove".
# Chat with a model directly in its thoughts.
@g023
g023 / human-in-the-loop-llm-trainer.py
Created March 27, 2025 23:21
Human-In-The-Loop LLM fine tuning using Unsloth
from unsloth import FastLanguageModel
import torch
from trl import SFTTrainer
from transformers import TrainingArguments
import datasets
import os
# description: This script allows users to interact with a language model,
# either querying it or fine-tuning it with new data. The model is loaded
# from a specified directory, and the user can choose to keep or replace
@g023
g023 / simple_text_predictor.py
Created March 26, 2025 02:51
This script is a simple n-gram text predictor that uses a frequency-based approach to predict the next token in a sequence. It can be trained on text files and can generate text based on the learned frequencies.
# Description: This script is a simple n-gram text predictor that uses a frequency-based approach to predict the next token in a sequence. It can be trained on text files and can generate text based on the learned frequencies. The script also includes functions for processing text files, cleaning data, and generating text based on user input.
# generates from all .txt files in a ./docs/ directory that is a directory in the same file this script is run.
# will reduce power of model on multiple passes to help reduce and trims some of the bottom feeders.
# Uses: Tiktoken for tokenization, multiprocessing for parallel processing, and chardet for encoding detection.
# pip install tiktoken chardet
@g023
g023 / simple_text_predictor.py
Last active March 25, 2025 05:41
Simple Text Prediction - Read all .txt from ./docs directory.
import random
def predict_next_token(sequence, ngram_freq, max_n=3):
for n in range(min(max_n, len(sequence) + 1), 0, -1):
context = tuple(sequence[-(n - 1):]) if n > 1 else ()
if context in ngram_freq[n]:
next_tokens = ngram_freq[n][context]
tokens, weights = zip(*next_tokens.items())
return random.choices(tokens, weights=weights, k=1)[0]
# Fallback to most frequent unigram
@g023
g023 / turbo_vector_rag_batch.py
Last active March 30, 2025 04:34
Turbo Vector RAG - Lean mean, multiple-instance with single LLM control with batch loading and Chunk Loading Strategies
# Just a simple class to handle a vector db instance for RAG with a manager class to handle multiple instances at once while sharing the model between instances.
# ability to save/load (saves as a pickle file) the vector db instance to disk (in folder ./_data/{md5}.pkl)
# ability to share model between instances for memory efficiency and speed of loading
# reference target RAG db with an id.
# -- now in turbo (batch) mode for adding segments to the db instance (much faster)
# -- automatically uses GPU if available
# -- added ability to load a file
# -- added multiple chunking strategies for documents (by sentences or by words using a sliding window with overlap)
# -- Just query like an LLM
0