Skip to content

Instantly share code, notes, and snippets.

View adntaha's full-sized avatar
🥯

Adnan Aidan T. adntaha

🥯
  • Montreal, Quebec
  • 16:49 (UTC -04:00)
View GitHub Profile
@adntaha
adntaha / mercator.ipynb
Last active March 10, 2026 05:51
Seems to be an attempt of mine to learn a bit more on how matplotlib assistant libraries can work in datasci, from march of 2024. Wow, its been two years since then.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adntaha
adntaha / spotify-install.ps1
Created March 10, 2026 05:36
Given you already have spicetify installed. Adds an adblocker and stuff to an app. From the 7th of january 2024
# Warning: this script is hardcoded to spotify 1.2.17.834.g26ee1129-633
$version = "1.2.17.834.g26ee1129-633"
spicetify restore --no-restart --quiet
Push-Location -Path %USERPROFILE%/Downloads
Invoke-WebRequest -Uri "https://upgrade.scdn.co/upgrade/client/win32-x86_64/spotify_installer-$version.exe" -OutFile "spotify-update-$version.exe"
Start-Process -FilePath "spotify-update-$version.exe"
@adntaha
adntaha / collatz.py
Created March 10, 2026 05:20
Naive implementation of the Collatz conjecture: if even, divide by two, if odd, times 3 plus 1, and you'll always end up in a 4, 2, 1 loop. Curious. I'm archiving this now but I made it a while ago (~12 november 2024)
def step(n: int) -> int:
return n*3+1 if n % 2 else n >> 1
for i in range(1, 1_000_000_000_000_000 + 1):
n = i
while n != 1:
n = step(n)
print(i, end=' ')
@adntaha
adntaha / set-theory.py
Last active January 31, 2026 02:50
had fun using recursive programming and set theory to mathematically define integers. unsurprisingly, the amount of brackets grows according to 2^n starting at 0.
>>> int_as_set = lambda n: [int_as_set(i) for i in range(n)]
>>> set_to_str = lambda s: "{" + ", ".join(set_to_str(e) for e in s) + "}"
>>> set_to_str(int_as_set(6))
'{{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}, {{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}}, {{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}, {{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}}}}'
@adntaha
adntaha / dont-edit-teams-docs.user.js
Last active June 8, 2023 02:04
because you don't want to accidentally edit a reference document a teacher forgot to mark as view-only and have your name appear on the Modified-By List of Shame™ - Userscript
// ==UserScript==
// @name Don't Edit Documents from Teams
// @version 1
// @include https://*.sharepoint.com/*
// @grant none
// ==/UserScript==
const searchParams = new URLSearchParams(location.search)
if (searchParams.get("wdOrigin") === "TEAMS-ELECTRON.teamsSdk.openFilePreview" && searchParams.get("action") === "edit") {
import os
import json
import torch
import transformers
assert (
"LlamaTokenizer" in transformers._import_structure["models.llama"]
), "LLaMA is now in HuggingFace's main branch.\nPlease reinstall it: pip uninstall transformers && pip install git+https://github.com/huggingface/transformers.git"
@adntaha
adntaha / prompt.md
Last active June 25, 2023 08:36
Clyde is Discord's AI Chatbot currently in alpha (https://dis.gd/clyde). Here lays attempts made at reverse engineering the prompt it uses. Clyde can also see the previous 50 messages in chat.

You are an AI named Clyde - and are currently chatting in a Discord server.

Consider the following in your responses:

  • Be conversational
  • Add unicode emoji to be more playful in your responses
  • Write spoilers using spoiler tags. For example ||At the end of The Sixth Sense it is revealed that he is dead||.
  • You can also reply with a gif, by using @gif("description of the gif you want to send"), for example if you wanted to send a cat gif, you would do: @gif("happy cat"). Gifs are a great way to represent emotion, and you should use them in your replies from time to time to add flavor to the conversation.
  • You can mention people by adding a @ before their name, for example if you wanted to mention yourself you should say @Clyde.

Format text using markdown:

@adntaha
adntaha / twitch-on-stream-timestamp.js
Created March 14, 2023 01:11
Add a timestamp on the Twitch stream itself
(() => {
const liveTime = document.querySelector('.live-time');
const style = document.createElement("style");
style.id = 'on-video-time-style';
style.textContent = `#on-video-time {
position: absolute;
padding: .5rem;
top: 0;
right: .3rem;
@adntaha
adntaha / delete-all-imgur-images.py
Last active October 22, 2022 21:31
delete all of the imgur images & dead imgur links in your history. download the script to the sharex folder and run it
#!/usr/bin/env python
import sys
import json
import requests
import urllib.request
from urllib.error import HTTPError, URLError
from datetime import datetime
ALSO_CLEAR_DEAD_IMGUR_LINKS = True
@adntaha
adntaha / sharex_history_cleaner.py
Last active September 17, 2022 05:23
remove dead links from history. download the script to the sharex folder and run it
import json
import sys
import urllib.request
from urllib.error import HTTPError, URLError
from datetime import datetime
HISTORY_PATH = ".\\History.json"
with open(HISTORY_PATH, "r") as f:
# backup