Skip to content

Instantly share code, notes, and snippets.

View santibreo's full-sized avatar
🐧
Learning . . .

ProphetJeremy santibreo

🐧
Learning . . .
View GitHub Profile
@santibreo
santibreo / pipelines.py
Created October 11, 2023 09:07
Python pipelines
# This pipeline waits for each step to finish completely (all
# the step arguments have to be processed) before running the next
# step
from functools import reduce
import time
def compose(*funcs):
return reduce(lambda f, g: lambda *x: g(*f(*x)), funcs)
@santibreo
santibreo / colored_logging.py
Created October 11, 2023 09:06
Python colored logging
import re
import logging
import sys
from typing import Callable
class TextEffect:
"""Represents a command that can be incorporated to log messages to apply
a text effect (bold, color, italics, ...) to following text"""
name_pattern = r'[A-Za-z0-9_/-]+'