Skip to content

Instantly share code, notes, and snippets.

View grimzy's full-sized avatar
🕶️
if not true then false

Joseph Estefane grimzy

🕶️
if not true then false
View GitHub Profile
@grimzy
grimzy / install-docker-bash-completion
Last active October 27, 2019 02:00
Install Docker completions on Mac
#!/usr/bin/env bash
brew install bash-completion
brew tap homebrew/completions
cat >> ~/.bash_profile <<EOL
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
EOL
@grimzy
grimzy / tcp_socket binding
Created December 5, 2016 02:30
Intellij Docker Binding
socat -d TCP-LISTEN:2376,range=127.0.0.1/32,reuseaddr,fork UNIX:/var/run/docker.sock
@grimzy
grimzy / rm-img-dangling
Created November 25, 2016 18:14
Docker commands
docker images -qf dangling=true | xargs docker rmi
@grimzy
grimzy / gitexec.cli
Created November 22, 2016 02:32
Executable file in Git
chmod u+x <filename>
git update-index --chmod=+x <filename>
git commit -am "<filename> is now executable."
@grimzy
grimzy / composer.nodebug
Last active November 23, 2016 05:35
Composer without xdebug
#!/usr/bin/env bash
# Adapted from From http://stackoverflow.com/a/36723363/2657607
function php_no_xdebug {
local temporaryPath="$(mktemp -t php.XXXX).ini"
# Using awk to ensure that files ending without newlines do not lead to configuration error
php -i | grep "\.ini" | grep -o -e '\(/[a-z0-9._-]\+\)\+\.ini' | grep -v xdebug | xargs awk 'FNR==1{print ""}1' > "$temporaryPath"
@grimzy
grimzy / phpx.bash
Last active May 29, 2019 17:49
Debugging Remote CLI with Phpstorm
#!/usr/bin/env bash
XDEBUG_CONFIG="idekey=PHPSTORM" PHP_IDE_CONFIG="serverName=$(hostname)" php -dxdebug.remote_host=`echo $SSH_CLIENT | awk '{print $1}'` "$@"