This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# WARNING: This script will remove all containers and images | |
echo -n "Do you want to factory-reset your docker (Y/n)? " | |
read answer | |
if [ "$answer" != "${answer#[Yy]}" ] ;then | |
# Stop all containers | |
docker stop $(docker ps -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: false | |
# This is the class that implements the DSL. | |
class Interpreter | |
def run(&block) | |
# Next line calls the block in the context of the instance. | |
instance_eval(&block) | |
end | |
def method_missing(name, **args, &block) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flatten = (input, ary = []) => { | |
if (!Array.isArray(input)) { return ary.push(input) }; | |
input.forEach((v) => flatten(v, ary)); | |
return ary; | |
}; |