Skip to content

Instantly share code, notes, and snippets.

View coderek's full-sized avatar
👽

Derek Zeng coderek

👽
View GitHub Profile
@coderek
coderek / docker-cleanup-resources.md
Created January 30, 2018 17:44 — forked from bastman/docker-cleanup-resources.md
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

@coderek
coderek / MiddlewarePattern.js
Created July 25, 2014 02:02 — forked from tastywheat/taskQueue.js
simple demonstration. this pattern is used by connect to stack middlewares
//process n number of async functions in order. used when promises aren't viable e.g. cross file or service calls.
var MiddlewareService = function(){
var stack = [],
isProcessingStack = false,
commonState = { task: 0 };
function push(fn){
stack.push(fn);
/**
* Copyright 2012 Akseli Palén.
* Created 2012-07-15.
* Licensed under the MIT license.
*
* <license>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,