Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / UniGifDepthMaterial.cs
Created January 28, 2025 04:53
mangle unigif to play Surface-Stable Fractal Dithering for purz POC
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using static System.Net.Mime.MediaTypeNames;
using System.Diagnostics;
/// <summary>
/// Loads and plays a GIF, assigning each frame to the material’s '_DepthTex' texture.
/// </summary>
@twobob
twobob / audio pipe.py
Created January 26, 2025 23:49
ideas for audio pipelines
#Phase 1: Data Preprocessing & Label Refinement
#1. Scraping Audio from YouTube
from yt_dlp import YoutubeDL
# Download audio from YouTube
def download_audio(url, output_dir="audio"):
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
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