Skip to content

Instantly share code, notes, and snippets.

View Davr1's full-sized avatar

Davri Davr1

  • 20:13 (UTC +02:00)
View GitHub Profile
@Davr1
Davr1 / gamma_trick.bat
Last active November 12, 2023 18:42 — forked from marcan/gamma_trick.sh
Two images in one using the PNG gamma header trick.
@echo off
rem PNG Gamma trick (by @marcan42 / marcan@marcan.st)
rem
rem This script implements an improved version of the gamma trick used to make
rem thumbnail images on reddit/4chan look different from the full-size image.
rem
rem Sample output (SFW; images by @Miluda):
rem https://mrcn.st/t/homura_gamma_trick.png
rem https://www.reddit.com/r/test/comments/6edthw/ (click for fullsize)
rem https://twitter.com/marcan42/status/869855956842143744
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Davr1
Davr1 / emojis.json
Last active August 3, 2022 13:05
Guilded emojis
{"NPCs": [{"id": 90000000, "name": "grinning", "category": "NPCs", "order": 1, "src": "https://img.guildedcdn.com/asset/Emojis/grinning.webp", "unicode": "😀", "codepoint": "1f600"}, {"id": 90000004, "name": "smiley", "category": "NPCs", "order": 2, "src": "https://img.guildedcdn.com/asset/Emojis/smiley.webp", "unicode": "😃", "codepoint": "1f603"}, {"id": 90000005, "name": "smile", "category": "NPCs", "order": 3, "src": "https://img.guildedcdn.com/asset/Emojis/smile.webp", "unicode": "😄", "codepoint": "1f604"}, {"id": 90000001, "name": "grin", "category": "NPCs", "order": 4, "src": "https://img.guildedcdn.com/asset/Emojis/grin.webp", "unicode": "😁", "codepoint": "1f601"}, {"id": 90000007, "name": "laughing", "category": "NPCs", "order": 5, "aliases": ["satisfied"], "src": "https://img.guildedcdn.com/asset/Emojis/laughing.webp", "unicode": "😆", "codepoint": "1f606"}, {"id": 90000006, "name": "sweat_smile", "category": "NPCs", "order": 6, "src": "https://img.guildedcdn.com/asset/Emojis/sweat_smile.webp", "unicod
We couldn’t find that file to show.
import requests
import re
import json
output = open("output.css", "w+")
# b"\xef\xb8\x8f" or \ufe0f or 65039 or emoji variation 16 is a character used to convert emojis between monochrome and colored.
# It was causing some issues because of inconsistencies between the emoji lists, so I just removed it
src = requests.get("https://canary.discord.com/assets/257f691a0fec8c6680a9.js")._content.replace(b"\xef\xb8\x8f", b"").decode("utf-8").replace("\n", "")
new_emojis = json.loads(requests.get("https://static.revolt.chat/mutant/downloads/1.0/mtnt_1.0_data.json")._content.decode("utf-8"))
import json
import re
from operator import itemgetter
import requests
# finds the most similar list
# master = []
# candidates = [{}, {}, {},...]
def best_similarity(master, candidates):
counts = [0] * len(candidates)
@Davr1
Davr1 / revolt-emojis.css
Created December 1, 2021 17:25
Brings revolt mutant emojis to discord
[src='/assets/da3651e59d6006dfa5fa07ec3102d1f3.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/smile.svg') !important; }
[src='/assets/2e41bfdeba797283ee9da9bb439c3ece.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/wink.svg') !important; }
[src='/assets/559c3311dcdb3f23b7fb745559207db9.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/upside_down_smile.svg') !important; }
[src='/assets/e461bb3847973d47822fdc79d66f494d.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/halo.svg') !important; }
[src='/assets/817f965bd1fd796777908e6c8052d665.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/content.svg') !important; }
[src='/assets/7c010dc6da25c012643ea22c1f002bb4.svg'] { content: url('https://static.revolt.chat/mutant/short/expressions/smileys/happy_fun/big_smile.svg') !important; }
[src='/assets/66f6