Skip to content

Instantly share code, notes, and snippets.

@dedoussis
dedoussis / delete_deployments.py
Created May 28, 2021 15:32
Delete all deployments of a given GitHub repository
#!/usr/bin/env python3
"""
Clears all deployments from a given repo
Requirements: pip install PyGithub
Usage: GITHUB_ACCESS_TOKEN=${MY_PAT} REPO_NAME=twbs/bootstrap delete_deployments.py
"""
from github import Github
@benhoyt
benhoyt / atomic_counter.py
Created August 3, 2016 13:12
An atomic, thread-safe incrementing counter for Python
"""An atomic, thread-safe incrementing counter."""
import threading
class AtomicCounter:
"""An atomic, thread-safe incrementing counter.
>>> counter = AtomicCounter()
>>> counter.increment()
@webspectyler
webspectyler / cp.sh
Created October 9, 2013 12:22
Copy all files including hidden directories
cp -a /mnt/sda8/john/. /mnt/sdb2/JOHN103