This file contains hidden or 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 | |
| set -e | |
| dir=$(cd ${1:-.} && pwd) | |
| if [ $? -ne 0 ] || [ ! -d "$dir" ] || [ ! -w "$dir" ]; then | |
| echo "$dir can not writable directory, abort." | |
| exit 1 | |
| fi |
This file contains hidden or 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/sh | |
| # | |
| # An example hook script to verify what is about to be committed. | |
| # Called by "git commit" with no arguments. The hook should | |
| # exit with non-zero status after issuing an appropriate message if | |
| # it wants to stop the commit. | |
| # | |
| # To enable this hook, rename this file to "pre-commit". | |
| # Redirect output to stderr. |
This file contains hidden or 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 | |
| CURRENT_DIR="$(pwd)" | |
| HAS_ERROR="" | |
| for file in $(git status -s | grep -E '^[AMU].*\.php$' | awk '{print $2}' | sort | uniq); do | |
| if [ "$(php -l $(pwd)/$file 2>&1 | grep 'Parse error')" != "" ]; then | |
| HAS_ERROR="1" | |
| echo "Syntax errors found: $file" >&2 | |
| fi |
This file contains hidden or 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
| <?php | |
| // validate client ip address | |
| $allow_ips = [ | |
| '::1', | |
| '10.0.2.2', | |
| '127.0.0.1', | |
| '192.168.33.1', | |
| ]; |
This file contains hidden or 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
| <?php | |
| $key = 0; | |
| switch($key) { | |
| case 'one': echo 'one'; break; | |
| case 'two': echo 'two'; break; | |
| case 'three': echo 'tree'; break; | |
| default: echo 'other'; break; | |
| } |
This file contains hidden or 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
| LANG=en_US.UTF-8 | |
| LC_CTYPE=en_US.UTF-8 | |
| USER=vagrant | |
| LOGNAME=vagrant | |
| HOME=/home/vagrant | |
| PATH=/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games | |
| MAIL=/var/mail/vagrant | |
| SHELL=/usr/bin/zsh | |
| SSH_CLIENT=10.0.2.2 50247 22 | |
| SSH_CONNECTION=10.0.2.2 50247 10.0.2.15 22 |
This file contains hidden or 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
| noaliases off | |
| allexport off | |
| noalwayslastprompt off | |
| alwaystoend on | |
| noappendhistory off | |
| autocd on | |
| autocontinue off | |
| noautolist off | |
| noautomenu off | |
| autonamedirs on |
This file contains hidden or 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
| 1='cd +1' | |
| 2='cd +2' | |
| 3='cd +3' | |
| 4='cd +4' | |
| 5='cd +5' | |
| 6='cd +6' | |
| 7='cd +7' | |
| 8='cd +8' | |
| 9='cd +9' | |
| _=sudo |
This file contains hidden or 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
| function import_setting() | |
| { | |
| [ -f $1 ] && . $1 | |
| } | |
| for f in $HOME/.zsh.d/* ; do | |
| import_setting $f | |
| done | |
| if [ $commands[brew] ]; then |
This file contains hidden or 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 | |
| function git_clone() | |
| { | |
| [ -z "$ZSH" ] && return | |
| url=https://gist.github.com/$1.git | |
| name=$2 | |
| path=$ZSH/custom/plugins/$name |