Skip to content

Instantly share code, notes, and snippets.

@judge2020
judge2020 / fixit.py
Last active December 9, 2023 05:45
Replace x.com/twitter.com with vxtwitter.com in clipboard
# python -m pip install pyperclip
# credit gpt4
import pyperclip
import time
from urllib.parse import urlparse, urlunparse
# Function to check if the content in the clipboard is a URL
def is_url(content):
try:
result = urlparse(content)
@judge2020
judge2020 / readme.md
Last active December 5, 2023 15:59
Fix MacOS Universal Control not working
@judge2020
judge2020 / README.md
Last active April 4, 2024 08:49
Initialize Discord bot in Python 3
  1. python3 -m pip install discord.py
  2. copy the script into a file (e.g. initialize.py)
  3. run python3 initialize.py
  4. quit once you see "We have logged in as <user#1234>"
@judge2020
judge2020 / README.md
Last active April 16, 2024 14:39
Download TikTok Favorites

Setup

  1. Sign into https://tiktok.com and go to your profile
  2. Click favorites or likes
  3. scroll down till all your videos load
  4. paste the script in console and run it
  5. Script will download the file containing newline-delimited links
  6. download via yt-dlp like so:

https://www.sec.gov/Archives/edgar/data/1477333/000119312519222176/d735023ds1.htm#:~:text=Key%20elements%20of%20our%20business%20model%20include%3A

Free customer base—Free customers are an important part of our business. These customers sign up for our service through our self-serve portal and are typically individual developers, early stage startups, hobbyists, and other users. Our free customers create scale, serve as efficient brand marketing, and help us attract developers, customers, and potential employees. These free customers expose us to diverse traffic, threats, and problems, often allowing us to see potential security, performance, and reliability issues at the earliest stage. This knowledge allows us to improve our products and deliver more effective solutions to our paid customers. In addition, the added scale and diversity of this traffic makes us valuable to a diverse set of global ISPs, improving the breadth and economic terms of our interconnections, bandwidth costs, and co-location expense

This opens an elevated Notepad process for editing the hosts file on Windows.

  1. Open a run box with Win+R
  2. Enter the following:
powershell Start-Process -Verb RunAs notepad C:\Windows\system32\drivers\etc\hosts
@judge2020
judge2020 / cg2glsl.py
Created September 21, 2021 01:56 — forked from rdb/cg2glsl.py
Convert Cg shaders designed for Panda3D to GLSL shaders. Requires cgc.exe to be installed (part of the NVIDIA Cg Toolkit)
import subprocess
import sys
import os
glsl_extensions = {'v': '.vert', 'f': '.frag', 'g': '.geom'}
if len(sys.argv) != 2:
print("Usage: cg2glsl.py something.sha")
sys.exit(1)
@judge2020
judge2020 / fixgpg.bat
Created June 24, 2020 13:26
Fix GnuPG/GPG4Win
REM place this on your desktop and click whenever GPG agent dies
gpgconf --kill gpg-agent
gpg-connect-agent reloadagent /bye
pause
# sudo su
# crontab -e
2 * * * * mkdir -p -m777 /tmp/cores && echo "/tmp/cores/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern