Skip to content

Instantly share code, notes, and snippets.

View embano1's full-sized avatar

Michael Gasch embano1

View GitHub Profile
@embano1
embano1 / gist:d0e77f639c2f3ae79d6e53196f309cb7
Last active May 3, 2017 18:35
docker-machine Driver for Play-with-Docker (PWD)
# Get latest release for PWD
https://github.com/franela/docker-machine-driver-pwd
# Unzip, and make sure the PWD driver for the OS is in $PATH
# Start a PWD session
http://labs.play-with-docker.com/
# Note the PWD ID (full http string)
@embano1
embano1 / gist:f77d54b89e061ae7c202a280ac98513e
Created June 14, 2017 12:45
zsh Prompt configuration (with Powerlevel9k)
**Install Theme**
Powerlevel 9k
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k (make sure to have Powerline fonts installed first, this method works for oh-my-zsh only)
Details and other installation options: https://github.com/bhilburn/powerlevel9k#installation
**Edit .zshrc**
ZSH_THEME="powerlevel9k/powerlevel9k"
DEFAULT_USER=$USER
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=" --"
@embano1
embano1 / gist:0570304e09070ee9411e105897d25164
Created August 6, 2017 06:57
Updating vscode dependencies, e.g. if defs and intellisense fail after vscode update
close VSCode and gocode close
go get -u github.com/rogpeppe/godef
go get -u github.com/nsf/gocode
man zshexpn
# echo hellow world
^hellow^hello
> echo hello world
(only works on last command)
# replace first arg string in a history command
!353:1:s^hello^hi
package main
import (
"fmt"
)
func main() {
s := string("\xF0\x9F\x98\x85")
b := []byte("\xF0\x9F\x8D\xBB")
fmt.Println(s,string(b))
@embano1
embano1 / gist:6a0be5a7f9b97d422159ba235d33ba2b
Last active February 14, 2018 14:29
Quickly change tmux Prefix in running Session
# Asuming prefix is C-b and change to C-a
C-b + :
set-option -g prefix C-a
@embano1
embano1 / README.MD
Created July 10, 2018 10:54
Search string/regex in git history, e.g. deleted/replaced code

Example for Kubernetes DebugContainers

$ git clone https://github.com/kubernetes/kubernetes
# Increase search limit and only print commit IDs
$ git -c diff.renameLimit=99999 log -SDebugContainers --pretty=format:"%h"
https://github.com/ashleyschuett/kubeconfig-cleanup/issues/5
@embano1
embano1 / README.MD
Created February 6, 2019 22:36
Download protected Videos (e.g. Vimeo) with youtube-dl
youtube-dl https://player.vimeo.com/video/299186608 --referer https://skillsmatter.com/skillscasts/12115-keynote-not-just-events-developing-asynchronous-microservices
@embano1
embano1 / xargs.MD
Last active February 18, 2019 13:10
find xargs rm

helps with space issues

find . -type f -ctime +80d -maxdepth 1 | xargs -I{} rm -v {}