Skip to content

Instantly share code, notes, and snippets.

View D-Brox's full-sized avatar

David Brochero D-Brox

  • Brasil
View GitHub Profile
@D-Brox
D-Brox / disable-touchscreen
Last active August 15, 2024 21:37
Script for disabling touchscreen on linux (by kidnapping the input with evtest)
#! /bin/env bash
device=$( cat /proc/bus/input/devices |
gawk '
/"ELAN Touchscreen"/{ inside = 1 }
/Handlers=/ { if(match($0,"event([0-9]+)",group))event = group[1] }
/^$/ { if(inside && event!="")print "/dev/input/event" event
inside = 0; event = ""
}')
@D-Brox
D-Brox / j-music.json
Last active July 25, 2023 22:12
J-Music United Server Initiative Coallition r/place template
{
"faction": "J-Music United Server Initiative Coallition",
"contact": "https://discord.gg/inabakumori",
"templates": [
{
"name": "Osage collab",
"sources": [
"https://user-images.githubusercontent.com/65723952/256029761-50083486-6000-43e6-b9af-19f57e6c0074.png"
],
"x": 2338,
@D-Brox
D-Brox / canary_borked_themes.md
Last active March 27, 2025 10:01
Unbork themes guide

Canary broke themes again -_-

What happened?

Discord's css is minified, with it's classes following the format name-hash. When they pushed a new asset to the canary build, the classes got renamed:

This means the classes on the themes don't relate to any discord class anymore.

So what now?

import json
import re
from operator import itemgetter
import requests
from itertools import combinations
def best_similarity(master, candidates):
counts = [0] * len(candidates)
for candidate_index, candidate in enumerate(candidates):
for item in candidate: