Skip to content

Instantly share code, notes, and snippets.

@ArthurDelannoyazerty
ArthurDelannoyazerty / timing_function_decorator.py
Last active August 12, 2025 14:36
EASY TO USE. LONG FILE. EXAMPLE AT THE BOTTOM. A decorator that time functions, and have advanced features : options to print to the console, to a default file, to a custom file. Can dynamically group functions by a tag. Can display a complete timing summary in the console. Can create chart that compare functions or compare whole groups.
"""
```
from . import timefunc, timing_manager
```
This module provides a comprehensive and thread-safe toolkit for performance monitoring
in Python applications. It is designed to be both easy to use for quick debugging
and powerful enough for detailed performance analysis.
The module is built around two core components:
@MuhammadYossry
MuhammadYossry / GoF refresher by example.md
Last active March 18, 2025 20:42
GoF patterns primer with refactor examples
import sqlite3
# Connect to the test.db database
conn = sqlite3.connect(":memory:")
cursor = conn.cursor()
# Create the news table
cursor.execute(
"""
CREATE TABLE IF NOT EXISTS news (
@pellucida
pellucida / classic-flexlm-lmgrd.txt
Last active March 10, 2025 17:54
No BS Classic Flex License manager
# Classic Flex License Manager (lmgrd)
Gory details can be read in
Book Name: License Administration Guide
Part Number: FNP-111411-LAG00
Product Release Date: March 2017
## Daemons
Clearing away the obfuscation around the license manager is fairly simple.
This license management has a vendor independent and vendor provided
@sainathadapa
sainathadapa / anti_join.py
Created May 9, 2018 10:00
anti-join-pandas
import pandas as pd
def anti_join(x, y, on):
"""Return rows in x which are not present in y"""
ans = pd.merge(left=x, right=y, how='left', indicator=True, on=on)
ans = ans.loc[ans._merge == 'left_only', :].drop(columns='_merge')
return ans
def anti_join_all_cols(x, y):