Skip to content

Instantly share code, notes, and snippets.

@carlbergman
carlbergman / .bash_completion
Last active May 10, 2017 07:37
Docker exec shortcut with Docker container name completion
# Autocomplete with running Docker container names
_dsh() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(docker ps --filter status=running --format='{{.Names}}')
if [[ ${cur} == * ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0

Keybase proof

I hereby claim:

  • I am carlbergman on github.
  • I am carlbergman (https://keybase.io/carlbergman) on keybase.
  • I have a public key whose fingerprint is 3178 A3B9 03FF 750A 90F3 8E6C AE57 355E 4C22 3A3B

To claim this, I am signing this object:

@carlbergman
carlbergman / Code.gs
Created July 16, 2015 09:38
Get filtered/non-filtered values from Google Sheet with Google Apps Script
/**
* Get values in range
*
* @param {String} rangeA1 The range in A1 notation
*
* @return {Array} array with non-filtered values
*/
function getValues (rangeA1) {
// Get range