Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / README.txt
Created June 17, 2025 12:09
Unfollow all twitter users. one by one. it will unfollow all visible users, scroll to the bottom to load the next batch, and repeat this process until no more "Following" buttons are found.
Instructions
Navigate to your "Following" list on X.com (e.g., https://x.com/your_username/following).
Open your browser's developer console (press F12 or Ctrl+Shift+I / Cmd+Opt+I).
Copy the entire script from the block below, paste it into the console, and press Enter.
The script will now run continuously. You can leave the browser tab open while it works.
It will log its progress and stop automatically when the list is exhausted.
Disclaimer: This script performs actions on your behalf.
Running automation scripts on social media platforms may be against their terms of service and could pose a risk to your account.
@twobob
twobob / videoLooper.py
Created May 22, 2025 03:57
Tries to make a perfect loop out of a video
import sys
import os
import cv2
import numpy as np
from skimage.metrics import structural_similarity as ssim
import threading
import time
import multiprocessing
import math
import queue
@twobob
twobob / index.html
Last active May 10, 2025 11:52
IOUBI alpha sim
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IOUBItopia Weaver</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
@twobob
twobob / whiten.html
Last active April 30, 2025 23:37
Service to remove sepia from open AI pictures. free. Client side
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DeSepAI Image</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js"></script>
<style>
body { margin:0; padding:1rem; background:#121212; color:#e0e0e0; font-family:sans-serif; display:flex; justify-content:center; }
.container { background:#1e1e1e; padding:1.5rem; border-radius:6px; width:100%; max-width:800px; position:relative; }
@twobob
twobob / 3090.py
Created April 13, 2025 18:54
bd3lm on windows, perplexity
\conda\envs\bd3lm\python.exe -u main.py loader.eval_batch_size=16 model=small algo=bd3lm algo.backbone=hf_dit data=openwebtext-split data.insert_valid_special=False model.length=1024 model.attn_backend=sdpa block_size=4 eval.checkpoint_path=kuleshov-group/bd3lm-owt-block_size4 wandb=null mode=ppl_eval strategy=single_device
bd3lm on windows, perplexity
Validation DataLoader 0: 100%|█████████████████████████████████████████████████| 6891/6891 [1:54:19<00:00, 1.00it/s]
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Validate metric ┃ DataLoader 0 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ sampling_eps_max │ 1.0 │
│ sampling_eps_min │ 0.0010000000474974513 │
@twobob
twobob / check_env_compatibility.py
Last active May 15, 2025 16:54
Checking requirements from: requirements.txt against envs in conda with a percentage matching report.
import json
import subprocess
import sys
import os
from pathlib import Path
import configparser
import re
from packaging.requirements import Requirement, InvalidRequirement
from packaging.version import parse as parse_version, InvalidVersion
from packaging.specifiers import SpecifierSet, InvalidSpecifier
@twobob
twobob / import.cmd
Created March 6, 2025 18:11
"import cv2, mediapipe" tester for conda envs
conda env list --json | python -c "import json,sys,subprocess as sp; from pathlib import Path; envs=json.load(sys.stdin)['envs']; [print(e, 'HAS cv2+mediapipe' if sp.run([str(Path(e, 'python.exe')), '-c', 'import cv2, mediapipe'], stdout=sp.DEVNULL, stderr=sp.DEVNULL).returncode==0 else 'DOES NOT') for e in envs]"
@twobob
twobob / collage_lyra_bnb.py
Created February 11, 2025 04:37
a low calorie version of the very fine https://huggingface.co/bleepybloops/flux-collage-v1 for machines with 16GB and up (probably)
#!/usr/bin/env python
"""
This script demonstrates how to load a quantized Flux.1-dev model (4-bit, NF4)
using bitsandbytes with Diffusers and then apply a LoRA adapter.
It loads:
(a) the T5EncoderModel from the "text_encoder_2" subfolder in 4-bit mode, and
(b) the FluxTransformer2DModel from the "transformer" subfolder in 4-bit mode.
Then it instantiates a FluxPipeline with device_map="balanced" and applies LoRA.
"""
import re
from datasets import load_dataset, Dataset
# Load and prep dataset
SYSTEM_PROMPT = """
Respond in the following format:
<reasoning>
...
</reasoning>
<answer>
@twobob
twobob / shun.js
Last active May 15, 2025 00:23
shun bluesky poster and post in one click - now added Above each post rather than Below, so you dont have to suffer looking at it first
javascript:(function(){function r(){return Math.floor(100*Math.random()+200)}function l(c){if("undefined"==typeof jQuery){var e=document.createElement("script");e.src="https://code.jquery.com/jquery-3.6.0.min.js";e.onload=function(){n("%E2%9C%85%20jQuery%20loaded");c&&c()};document.head.appendChild(e)}else{n("%E2%9C%85%20jQuery%20present");c&&c()}}function u(){if(!document.getElementById("s-status")){var e=document.createElement("div");e.id="s-status";e.style.cssText="position:fixed;bottom:10px;right:10px;padding:10px;background:#000;color:#fff;font-size:14px;border-radius:5px;opacity:.9;z-index:9999;max-width:300px";e.innerHTML='<strong>Shun%20Status:</strong><div%20id="s-log"></div>';document.body.appendChild(e)}}function%20n(e){u();var%20c=document.getElementById("s-log");c&&(c.innerHTML+=e+"<br>",clearTimeout(window.sTimeout),window.sTimeout=setTimeout(function(){c.innerHTML=""},1e4))}function%20t(){var%20e=$('[data-testid^="feedItem-by-"]');e.length?(e.each(function(){$(this).find(".s-btn").length||$(thi