Skip to content

Instantly share code, notes, and snippets.

using System.Collections.Generic;
using UnityEngine;
public static class StripUtility
{
// 1) Remove specified vertices
// 2) Re-sort remaining verts by angle around the centroid
// Ensures a consistent winding for a triangle strip after removal
public static void RemoveAndReorder(ref List<Vector3> verts, List<int> indicesToRemove)
{
@twobob
twobob / overlap.cs
Created January 5, 2025 00:17
overlap circle code?
using UnityEngine;
public class CircleOverlapExample : MonoBehaviour
{
[System.Serializable]
public struct Circle
{
public Vector2 center;
public float radius;
}
@twobob
twobob / call_dave.py
Last active February 24, 2025 23:41
telnet - call dave
#!/usr/bin/env python3
"""
Feature-complete Telnet client with a curses-based text UI.
Adjusted to:
- Automatically try "pdp1173.com" on port 23 and log in as "guest".
- If that fails, try "davepl.dyndns.org" on port 23 with "guest".
- Repeat this connection attempt loop forever until ESC is pressed to quit.
- Once connected and logged in, display remote output and allow typing commands.
- Typing 'exit' closes the current session and resumes connection attempts.
- Pressing ESC at any point quits the program immediately.
@twobob
twobob / calibration_datav3.txt
Created December 8, 2024 10:47 — forked from bartowski1182/calibration_datav3.txt
Calibration data provided by Dampf, combines his own efforts on top of Kalomaze's. Used for calibrating GGUF imatrix files
In addition to a significant decrease in hepatic lipid accumulation in the IOE group, which inhibited energy intake by propionate enrichment, hepatic lipids were also significantly reduced in the mice in the IOP group, which was largely enriched with butyrate. Compared with the IOE group, IOP had a stronger regulatory effect on hepatic metabolism and triglyceride metabolism and higher levels of TCA cycle in the host. In addition, butyrate has the ability to promote browning of white adipose tissue (WAT) to brown adipose tissue (BAT).^[@ref39],[@ref40]^ WAT stores energy, whereas BAT uses energy for heating and consequently host energy expenditure increases.^[@ref41],[@ref42]^ However, adipose tissue weight does not change after WAT browning.^[@ref43]^ Therefore, the weight of adipose tissue of mice in the IOP group dominated by butyrate was greater than that of the mice in the IOE group dominated by propionate.
In conclusion ([Figure [7](#fig7){ref-type="fig"}](#fig7){ref-type="fig"}C), the improvement of ob
@twobob
twobob / chatty.py
Created December 7, 2024 14:54
(Windows only RN) call upon a local llm for logical responses, scrape audio with whisper, respond with the Window TTS
# Step 1: Import necessary libraries and modules
import warnings
import pyaudio
import wave
import whisper
import openai
import os
import numpy as np
import pyttsx3
@twobob
twobob / config.json
Created December 2, 2024 14:59
gemma 2 config
{
"architectures": [
"Gemma2ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"attn_logit_softcapping": 50.0,
"bos_token_id": 2,
"cache_implementation": "hybrid",
"eos_token_id": [
@twobob
twobob / 5mb.py
Created October 28, 2024 19:47
aim to hit a size without going over for mp4 files
import argparse
import subprocess
import os
from pathlib import Path
def compress_video(input_file, output_file, target_size_mb=5, initial_bitrate=500,
initial_scale=640, min_bitrate=50, min_scale=100, audio_bitrate=96,
max_attempts=5):
"""
Compress a video file to a target size while adjusting bitrate and scale.
@twobob
twobob / TsneWavs.py
Last active October 13, 2024 10:36
wav classifier (sort by reduced features revision)
import os
import argparse
import librosa
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.cluster import KMeans
@twobob
twobob / DisableWavPreview.reg
Created October 7, 2024 17:41
enable WAV file preview in the Windows 11 sidebar by associating WAV files with a specific shell extension handler and defining the preview handler in the Windows registry
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\.wav\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers]
"{031EE060-67BC-460d-8847-E4A7C5E45A27}"=-
@twobob
twobob / levicon.py
Created September 23, 2024 01:32
creating meaningful categories based on classifications parsed from a song name
from collections import Counter
# Provided text
import os
import glob
# Define the directory path
dir_path = r"E:\Dubstep_diffusion\tracks"
# List all .wav and .mp3 files using glob with wildcard matching