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
View test.skema
[{"name":"posts","color":"Green","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":true,"column":[{"name":"id","type":"increments","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c113","order":0}],"relation":[],"seeding":[]}]
View blog.skema
[{"name":"posts","color":"Blue","position":{"x":496,"y":51},"increment":false,"timestamp":false,"softdelete":false,"column":[{"name":"id","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":true,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c281","order":0},{"name":"title","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c289","order":1},{"name":"content","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c297","order":2},{"name":"category_id","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":true,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"h
@shengyou
shengyou / 2015-laravel-demo.skema
Last active Aug 29, 2015
the description for this gist
View 2015-laravel-demo.skema
[{"name":"posts","color":"Blue","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"id","type":"increments","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0},{"name":"title","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c31","order":1},{"name":"sub_title","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c77","order":2},{"name":"content","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"h
View 2015-ntpc-laravel-workshop.skema
[{"name":"posts","color":"Blue","position":{"x":499,"y":79},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"id","type":"increments","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0},{"name":"title","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c31","order":1},{"name":"sub_title","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c77","order":2},{"name":"content","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hi
@shengyou
shengyou / os.bat
Last active Aug 15, 2016
Windows 平台下用 cmd.exe 偵測作業系統版本。(用於 wagon 裡依作業系統版本動態載入不同 PHP 版本)
View os.bat
@for /f "tokens=2 delims=[]" %%G in ('ver') do @set _version=%%G
@for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') do @set _major=%%G& @set _minor=%%H& @set _build=%%I
@if "%_major%"=="10" (
set PHP_INSTSLL_ROOT=%WAGON_ROOT%\uwamp\bin\php\php-7.0.3
) else (
set PHP_INSTSLL_ROOT=%WAGON_ROOT%\uwamp\bin\php\php-5.6.18
)
@shengyou
shengyou / append.sh
Created Aug 15, 2016
在 bash 裡使用 sudo 將某字串/字段加到檔案的最後面
View append.sh
#!/usr/bin/env bash
# some string 是要加入的字串
# /target/file/path 是要寫入的檔案
# --append 是加到檔案最後,沒加的話就是覆蓋掉整個檔案
# > /dev/null 是防止 tee 輸出
echo 'some string' | sudo tee --append /target/file/path > /dev/null
# 也可以把一段文字加進去
BLOCK="
@shengyou
shengyou / ip.sh
Created Aug 15, 2016
在 bash 裡取得機器的對外實體 IP
View ip.sh
#!/usr/bin/env bash
ip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "My WAN/Public IP address: ${ip}"
@shengyou
shengyou / mysql.sh
Created Aug 15, 2016
安裝 MySQL 時不要彈出互動視窗問密碼
View mysql.sh
#!/usr/bin/env bash
echo "mysql-server mysql-server/root_password password strangehat" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password strangehat" | sudo debconf-set-selections
@shengyou
shengyou / 0_reuse_code.js
Created Aug 15, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shengyou
shengyou / initialize.sh
Last active Aug 24, 2016
COSCUP 2016 Laravel 部署工作坊裝機指令集
View initialize.sh
# get startup.sh from gist
wget https://gist.githubusercontent.com/shengyou/644b1ac28fa05e34146369e4bda53176/raw/06028bf9e9870aaed0085261bdbdbcc91a6b0128/startup.sh
# run startup script
bash startup.sh
# generate ssh key
ssh-keygen -t rsa -b 4096 -C "{your email}"
# clone your app
You can’t perform that action at this time.