Skip to content

Instantly share code, notes, and snippets.

View e4c5's full-sized avatar
💭
Save trees

Raditha Dissanayake e4c5

💭
Save trees
View GitHub Profile
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@e4c5
e4c5 / round_robin.py
Last active February 9, 2024 08:05
A round robing pairing generator where you are control the round in which certain players get the bye or meet certain other players. If a large number of rounds need to be fixed in this manner and they involve players other than the Bye, there is no guarantee that a pairing exists.
import sys
import random
from itertools import permutations
class RoundRobin(object):
'''
Usage:
r = RoundRobin(['Bye','Nigel','Wellignton','Andrew','Sherwin','Chollapat','David','Craig'])
r.fix_pairing('Nigel',5, 'Bye')
r.fix_pairing( 'Craig',0,'Bye')