Skip to content

Instantly share code, notes, and snippets.

Shengyou Fan shengyou

Block or report user

Report or block shengyou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shengyou
shengyou / phinx.php
Created Oct 4, 2016
setup phinx config using php instead of yaml file.
View phinx.php
<?php
require __DIR__.'/bootstrap.php';
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds',
],
'environments' => [
View pull-phpbrew-docker-image.sh
# 啟動 Docker Image,並把當前目錄掛載到 Docker Image 裡
docker run -it -v $PWD:/src phpbrew/phpbrew:php7.3-minimum-zts
# 以下指令請在 Docker Image 裡執行
# 使用 PHPBrew 切換到 PHP 7.3
phpbrew use 7.3
# 檢查開發環境是否正確
php -v
php-config
View clone-php-73.sh
git clone git@github.com:php/php-src.git
cd php-src
git checkout php-7.3.3
@shengyou
shengyou / helpers.php
Last active Aug 10, 2018
env() helper functions without Laravel framework
View helpers.php
<?php
if (! function_exists('env')) {
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
View .zshrc
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
View .zshrc
# 從 Github 安裝
zplug "zsh-users/zsh-history-substring-search"
# 從 on-my-zsh 安裝
zplug "plugins/git", from:oh-my-zsh
# 指定 tag
zplug "b4b4r07/enhancd", at:v1
# 依作業系統載入
View .zshrc
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_DISABLE_RPROMPT=true
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir newline vcs)
You can’t perform that action at this time.