發表文章

目前顯示的是 2020的文章

Markdown

The S.O.L.I.D Principles in Pictures

https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898

[Laravel] composer 套件開發

圖片
實作內容: https://github.com/ceparadise168/cart 建立 Cart 套件 目標:  設計一個購物車物件,這個物件可以增加商品、計算總價、回傳商品總數量。  設計成能以 PSR-4 載入的套件。  重構商品  重構購物車  增加購物車功能  發佈套件  研究 CircleCI 建立專案 composer create-project laravel/laravel Cart --prefer-dist 移動到專案目錄下 cd Cart 建立套件 建立套件目錄,格式為 packges/開發商(作者)/套件名稱,並建立兩個資料夾分別為 src、tests mkdir -p packges/ceparadise168/cart/src mkdir -p packges/ceparadise168/cart/test cd packges/ceparadise168/cart 初始化 composer 設定,安裝 phpunit composer init composer require phpunit/phpunit --dev composer.json 如下 { "name": "ceparadise168/cart", "authors": [ { "name": "Eric Tu", "email": "ceparadise168@gmail.com" } ], "require": {}, "require-dev": { "phpunit/phpunit": "^8.5" }, "autoload": { "psr-4": { "Ceparadise168\\Cart\\": "src/"...

[好文]图解MySQL里的各种 JOIN,看完不懂来找我!

https://database.51cto.com/art/201908/602009.htm

Laravel 測試第三方套件透過 Facade 省略 DI 並透過 mock Facade 取代 mock service

Defense Programming: Anticipating Failures with Tests https://laravel-news.com/defense-programming-anticipating-failures-tests Facade vs DI (when to use) https://stackoverflow.com/questions/19193532/laravel-4-facade-vs-di-when-to-use

[填坑] 《Bash 脚本教程》- 阮一峰

http://www.ruanyifeng.com/blog/2020/04/bash-tutorial.html https://wangdoc.com/bash/intro.html

[好文] 如何选择 Git 分支模式?

https://mp.weixin.qq.com/s/9Ey04P5Xv4W95N2FEioZ1g

Start a Linux Process / Command in Background

Start a Linux Process / Command in Background #一般執行 cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ sleep 300 #背景執行 cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ sleep 300 & [1] 2524 #背景執行 cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ sleep 400 & [2] 2528 #查看背景工作 cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ jobs [1]- Running sleep 300 & [2]+ Running sleep 400 & cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ jobs -l [1]- 2524 Running sleep 300 & [2]+ 2528 Running sleep 400 & #帶回 foreground cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ fg %1 sleep 300 # ctrl + z 暫停並放到 background [1]+ Stopped sleep 300 cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ # ctrl + z # 此時背景中 pid 2524 狀態是 Stopped cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop $ jobs -l [1]+ 2524 Stopped sleep 300 [2]- 2528 Running sleep 400 & # 使用 bg 讓 process 重新再背景執行 cepar@DESKTOP-H3LUMQB MINGW64 ~/D...

[Laravel] 從 public/index 開始的 Laravel Architecture Concepts

Laravel Architecture Concepts (DRAFT) tags:  Laravel Index Request Lifecycle First Things HTTP / Console Kernels Service Providers Dispatch Request Service Container Introduction Binding Resolving Container Events PSR-11 Service Providers Introduction Writing Service Providers The Register Method The Boot Method Registering Providers Deferred Providers Request Lifecycle First Things public\index.php <?php /** * Laravel - A PHP Framework For Web Artisans * * @package Laravel * @author Taylor Otwell <taylor @laravel .com> */ define( 'LARAVEL_START' , microtime( true )); /* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for | our application. We just need to utilize it! We'll simply require it...