Skip to content

Instantly share code, notes, and snippets.

View cvasqxz's full-sized avatar
💣
perro bomba

César cvasqxz

💣
perro bomba
View GitHub Profile
@cvasqxz
cvasqxz / hola.py
Created May 16, 2021 21:44
Hello World with SHA256 hash collision
from hashlib import sha256
t = b'hola'
h = b''
while not t in h: h = sha256(h).digest()
p = h.find(t)
print(h[p:p+len(t)].decode('utf-8'))
@cvasqxz
cvasqxz / keymap.c
Last active October 4, 2022 14:01
QMK planck/rev6_drop
#include QMK_KEYBOARD_H
enum layers {
_QWERTY = 0,
_LOWER,
_RAISE,
_ADJUST,
};
#define LOWER MO(_LOWER)
@cvasqxz
cvasqxz / moonphase.py
Created October 2, 2023 21:16
moon phase calculator
from time import time
def moon():
MOON_DURATION = 29.53058770576
KNOWN_NEW_MOON_EPOCH = 947116800
SECONDS_IN_A_DAY = 86400
PHASES = ["🌑", "🌘", "🌗", "🌖", "🌕", "🌔", "🌓", "🌒", "🌑"]
moonphase = (time() - KNOWN_NEW_MOON_EPOCH)/SECONDS_IN_A_DAY