Skip to content

Instantly share code, notes, and snippets.

@icezyclon
icezyclon / read_write_lock.py
Last active June 17, 2025 18:32 — forked from Eboubaker/read_write_lock.py
Python Reentrant Read Write Lock: Allowing Multithreaded Read Access But Only a Single Writer. Fixed a bug (deadlock while using read and write with context managers), updated with 3.10+ type information and added some tests.
import contextlib
import threading
from typing import Generator
class ReentrantRWLock:
"""This class implements reentrant read-write lock objects.
A read-write lock can be aquired in read mode or in write mode or both.
Many different readers are allowed while no thread holds the write lock.
@tavinus
tavinus / cloudsend.sh
Last active May 22, 2026 15:41
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
# MIGRATED TO REPOSITORY
# https://github.com/tavinus/cloudsend.sh
#
# This gist will NOT be updated anymore
############################################################
############################################################