This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from os import getenv | |
_paths = getenv("PATH").split(":") | |
def print_type(title: str, _filter: tuple): | |
print(f"\n@{title.title()} dirs:") | |
for (index, fp) in enumerate(filter(lambda fp: fp.startswith(_filter), _paths), 1): | |
print(f"{index:3}- {fp}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from sys import argv | |
from random import randint, choice | |
from time import strftime, sleep | |
from curses import (textpad, curs_set, KEY_RIGHT, | |
KEY_LEFT, KEY_DOWN, KEY_UP, | |
wrapper, COLOR_RED) | |
####################### start advanced config ######################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
python3.9 -B $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
_file=$1 | |
_file_name=$(python3 -c "print('$_file'.split('.', maxsplit=1)[0])") | |
javac $_file && | |
java $_file_name && | |
rm $_file_name.class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
_file=$1 | |
_file_name=$(python3 -c "print('$_file'.split('.', maxsplit=1)[0])") | |
g++ $_file -o $_file_name && | |
./$_file_name && | |
rm $_file_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from PIL import Image | |
import os.path | |
import sys | |
def resize_img(path: str, w: int, h: int) -> str: | |
image = Image.open(path) | |
new_image = image.resize((int(w), int(h))) | |
filename = os.path.basename(path).split(".", 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from PIL import Image | |
import configparser | |
import subprocess | |
import sys | |
import os | |
def fetch_desktop_image() -> str: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo() { | |
if alias "$1" &> /dev/null; then | |
command sudo $(alias $1 | cut -d '=' -f 2) ${@:2} | |
else | |
command sudo "$@" | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import overload, Any | |
class List(list): | |
@overload | |
def __getitem__(self, t: tuple, /) -> list[Any]: ... | |
def __getitem__(self, v, /): | |
if isinstance(v, tuple): | |
_v = None | |
for i in v: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Greet: | |
class Types(StrEnum): | |
morning: str = "morning" | |
afternoon: str = "afternoon" | |
evening: str = "evening" | |
@staticmethod | |
def morning(hour: int) -> bool: | |
return 5 <= hour < 12 |
OlderNewer