Skip to content

Instantly share code, notes, and snippets.

@rkuzsma
rkuzsma / docker-bash-completion.md
Last active November 18, 2023 09:11
How to configure Bash Completion on Mac for Docker and Docker-Compose

How to configure Bash Completion on Mac for Docker and Docker-Compose

Copied from the official Docker-for-mac documentation (thanks Brett for the updated doc pointer):

Install shell completion

Docker Desktop for Mac comes with scripts to enable completion for the docker, docker-machine, and docker-compose commands. The completion scripts may be found inside Docker.app, in the Contents/Resources/etc/ directory and can be installed both in Bash and Zsh.

Bash

Bash has built-in support for completion To activate completion for Docker commands, these files need to be copied or symlinked to your bash_completion.d/ directory. For example, if you installed bash via Homebrew:

@hrules6872
hrules6872 / SpaceItemDecoration.java
Last active April 25, 2020 12:04
Space ItemDecoration for RecyclerView
public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
private static final boolean DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM = false;
private static final boolean DEFAULT_ADD_SPACE_BELOW_LAST_ITEM = false;
private final int space;
private final boolean addSpaceAboveFirstItem;
private final boolean addSpaceBelowLastItem;
public SpaceItemDecoration(int space) {
this(space, DEFAULT_ADD_SPACE_ABOVE_FIRST_ITEM, DEFAULT_ADD_SPACE_BELOW_LAST_ITEM);