Skip to content

Instantly share code, notes, and snippets.

View mvrozanti's full-sized avatar

Marcelo mvrozanti

View GitHub Profile
-- lightning.lua
graph = {
["ESC"] = {"F1", "GRAVE", "1"},
["F1"] = {"ESC", "F2", "1", "2", "3"},
["F2"] = {"F1", "F3", "2", "3"},
["F3"] = {"F2", "F4", "3", "4", "5"},
["F4"] = {"F3", "F5", "4", "5", "6"},
["F5"] = {"F4", "5", "6", "7", "F6"},
["F6"] = {"F5", "F7", "6", "7", "8"},
["F7"] = {"F6", "F8", "7", "8", "9"},
local unpack = table.unpack or unpack
keys = keyleds.groups[keyleds.config.group] or keyleds.db
width = tonumber(keyleds.config.width) or 13
height = tonumber(keyleds.config.height) or 5
snakeColor = tocolor(keyleds.config.snakeColor) or tocolor('green')
foodColor = tocolor(keyleds.config.foodColor) or tocolor('red')
snakeHeadColor = tocolor(keyleds.config.snakeHeadColor) or tocolor('orange')
snakeTailColor = tocolor(keyleds.config.snakeTailColor) or tocolor('purple')
delay = tonumber(keyleds.config.delay) or 100
@mvrozanti
mvrozanti / remove-reddit-attribution-banner.py
Last active January 13, 2024 03:51
Script to remove the reddit attribution banner using Pillow in python
#!/usr/bin/env python
import argparse
from PIL import Image
import os
def remove_reddit_banner(image_path, dry_run=False):
image = Image.open(image_path)
try:
has_banner = has_reddit_banner(image)
except:
@mvrozanti
mvrozanti / chess-com-downloader.js
Created September 6, 2023 15:48
Download chess.com games en masse
(async () => {
year=2023
username = 'hikaru'
for(var month=1; month<=12; month++) {
let url = `https://api.chess.com/pub/player/${username}/games/${year}/${month}/pgn`
response = await fetch(url)
const bodyText = await response.text();
const blob = new Blob([bodyText], { type: 'text/plain' });
const a = document.createElement('a');
a.style.display = 'none';
@mvrozanti
mvrozanti / lspkgdsk.sh
Created March 1, 2023 02:12
List installed packages sorted by size on disk
pacman -Qi | awk '/^Name/{name=$3} /^Installed Size/{print name " : " $4 $5}' | sort -h -k 3
@mvrozanti
mvrozanti / upwork-dark.css
Last active January 20, 2023 02:22
Upwork Dark Theme CSS
:root {
--body-bg: #1e1e1e !important;
--nav-tooltip-text: white !important;
--nav-text: white !important;
--up-black: white !important;
--tab-active-bg-color: white !important;
--bg-inverse: #1e1e1e !important;
--skill-bg: #1e1e1e !important;
--skill-color: white !important;
--nav-dropdown-link-text: black;
@mvrozanti
mvrozanti / autoscroll.js
Last active January 11, 2023 02:46
Automatically scroll a page using javascript
let stop = false
let amount = 5
let delay = 10
function pageScroll() {
window.scrollBy(0, amount);
if(!stop)
scrolldelay = setTimeout(pageScroll,delay);
}
@mvrozanti
mvrozanti / clear_screen.js
Created January 16, 2021 01:40
Globo TV nativefier
setTimeout(
function(){
var bad_banner;
do {
bad_banner = document.querySelector('#cookie-banner-lgpd')
}while(!bad_banner);
bad_banner.remove()
document.querySelector('#app > div > div > div > header').remove().remove()
}, 1000)
@mvrozanti
mvrozanti / gatekeeper.py
Last active December 30, 2019 05:55
RAT-via-Telegram shell edition (shellinabox)
#!/usr/bin/env python
from distutils.spawn import find_executable
import argparse
import os
import psutil
import requests
import signal
import subprocess
import sys
import telepot
@mvrozanti
mvrozanti / sinon.py
Last active October 24, 2021 00:41
Consulta de sinônimos e antônimos de uma palavra no português brasileiro
#!/usr/bin/env python
from bs4 import BeautifulSoup
import requests
SIN_URL = 'https://www.sinonimos.com.br/'
ANT_URL = 'https://www.antonimos.com.br/'
def main(palavra):
sess = requests.session()