Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am alemidev on github.
* I am alemidev (https://keybase.io/alemidev) on keybase.
* I have a public key ASDTfh8JGSpZ1wl46woE2dfdUhxmzOnm_Fjpm4E2CYugZQo
To claim this, I am signing this object:
@alemidev
alemidev / commit-msg.sh
Last active July 16, 2023 18:17
A git hook that forces you to respect Commit Convention
#!/bin/bash
#
# Commit Convention Hook | alemi <me@alemi.dev> May 2022
#
# A simple git hook to enforce (sort of) Commit Convention.
# www.conventionalcommits.org
#
# This script uses bash builtin regex matching, so it's not sh compatible.
#
# Commit message will be stripped of comments (lines starting with #) and matched
@alemidev
alemidev / debugtool.py
Last active March 6, 2022 19:03
Some tools to debug bots and applications as a plugin for my telegram bot framework
import asyncio
import io
import logging
import sys
import inspect
from alemibot import alemiBot
from pyrogram import filters
from pyrogram.types import MessageEntity, ReplyKeyboardMarkup
@alemidev
alemidev / state_dict.py
Created January 6, 2022 17:42
A wrapper around python dictionaries/objects to make it accessible (and settable) deeply
import json
class StateDict(dict):
"""
This is a convenience class. This won't raise KeyErrors but just return None.
It will also print nicely and convert any dict fed in to this type too. If a non existing key
is requested, an empty new StateDict will be added for that key, so that saving in sub-dictionaries
directly is allowed ( from an empty dict, you can do d['a']['b'] ). If a field exists as an empty
dict, it was requested before being set
"""