Skip to content

Instantly share code, notes, and snippets.

@eduardocardoso
eduardocardoso / gist:82a629882ddb02ab3677
Last active May 25, 2020
Script to delete exited containers and untagged/unused images from docker
View gist:82a629882ddb02ab3677
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@cgrand
cgrand / tarjan.clj
Last active Nov 5, 2016
Implementing Tarjan in Clojure, step by step
View tarjan.clj
;; Now, replace the loop by more telling operations.
(defn tarjan
"Returns the strongly connected components of a graph specified by its nodes
and a successor function succs from node to nodes.
The used algorithm is Tarjan's one."
[nodes succs]
(letfn [(sc [env node]
; env is a map from nodes to stack length or nil, nil means the node is known to belong to another SCC
; there are two special keys: ::stack for the current stack and ::sccs for the current set of SCCs
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@eligrey
eligrey / object-watch.js
Created Apr 30, 2010
object.watch polyfill in ES5
View object-watch.js
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
You can’t perform that action at this time.