Skip to content

Instantly share code, notes, and snippets.

View david-lev's full-sized avatar
:octocat:
Coding

David Lev david-lev

:octocat:
Coding
View GitHub Profile
@david-lev
david-lev / cache_decorators.py
Last active April 13, 2023 21:19
Cache management in Python, in-memory, efficiently and quickly, with decorators
import logging
from functools import wraps
from typing import Any, Optional, Tuple, Dict, Hashable, Iterable, Callable
logger = logging.getLogger(__name__)
"""
https://github.com/david-lev (c) 2023
**Cache management in Python in memory efficiently and quickly.**
@david-lev
david-lev / sai.sh
Last active May 25, 2025 22:39
This script allows you to install split-apks with one adb shell command!
#!/system/bin/sh
# Split APKs Installer | SAI #
: '
This script allows you to install splits-apk with one adb shell command! push this script to your device with adb and run it:
usage: sh sai.sh [path/to/folder/with/the/apks] [installer pkg (optional)] [originating-uri (optional)]
example: sh sp_installer.sh "/data/local/tmp/wa_app/" "com.android.vending" "171faa8c8918"
Author: David Lev (github.com/david-lev)
'
echo "<<< Split APKs Installer | github.com/david-lev >>>\n"
@david-lev
david-lev / termux-weather.sh
Last active September 26, 2021 17:45
A simple bash script used to display the weather in the terminal based on the location of the device (Work's better on termux https://github.com/david-lev/termux-weather
#!/data/data/com.termux/files/usr/bin/bash
# https://github.com/david-lev/termux-weather
# Author: David Lev (github.com/david-lev)
# Variables
end='\e[0m'
red='\e[31m'
green='\e[32m'
yellow='\e[33m'
@david-lev
david-lev / mac_to_deviceid.py
Last active November 10, 2021 22:32
Convert mac-address to device id
chars = {
"0": "00",
"1": "01",
"2": "02",
"3": "03",
"4": "04",
"5": "05",
"6": "06",
"7": "07",
"8": "08",
@david-lev
david-lev / GetTelegramIDbot.py
Created June 2, 2021 02:20
a simple telegram bot to get id for channels, groups and users
from pyrogram import Client, filters, types
token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
app = Client("get_id_bot", 777074324, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX", bot_token=token)
@app.on_message(filters.group)
def group(_, msg:types.Message):
msg.reply(f"מזהה הקבוצה: `{msg.chat.id}`")
msg.chat.leave()
from pyrogram import Client, filters, types
app = Client("capslock")
caps = {
"q": "/",
"w": "'",
"e": "ק",
"r": "ר",
"t": "א",