Avatar 💻

recca0120 技術筆記

Software Developer / 技術筆記

  1. 首頁
  2. 彙整
  3. 分類
  4. 標籤
  5. 搜尋
  6. 關於我
    1. 夜晚模式

紀錄

2026 3
2024 3
2023 11
2022 13
2020 15
更多

分類

Laravel PHP Testing Database DevOps Frontend MacOS Windows

標籤雲

Laravel PHP Testing PHPUnit Blade Guzzle Mockery SQLite Composer Docker Linux Migration MySQL Redis Validation Alpine.js AWS Eloquent JavaScript MacOS
Featured image of post Laravel LazyCollection 搭 Generator 為何延遲載入失效
Laravel PHP

Laravel LazyCollection 搭 Generator 為何延遲載入失效

直接把 Generator 傳給 LazyCollection 會被 iterator_to_array 一次全部展開,失去延遲載入效果,必須用 Closure 包一層才能正確運作。

2020 年 8 月 17 日
English
Laravel PHP
Featured image of post GuzzleHttp getContents() 第二次回傳空字串的原因
PHP

GuzzleHttp getContents() 第二次回傳空字串的原因

GuzzleHttp Response 用 (string) 轉換每次都自動 seek(0),但 getContents() 不會重置指標,第二次呼叫只拿到空字串,需手動 rewind。

2020 年 8 月 5 日
English
Guzzle PSR-7 PHP
Featured image of post 用 bluetoothctl 讓樹莓派連上藍芽裝置
DevOps

用 bluetoothctl 讓樹莓派連上藍芽裝置

樹莓派沒有桌面環境時,用 bluetoothctl 的 scan、pair、trust、connect 指令完成藍芽配對,加上 trust 指令讓下次開機自動重新連線。

2020 年 7 月 21 日
English
Raspberry Pi Bluetooth Linux
Featured image of post 解決 Redis 6.0 升級後的 Connection Refused 錯誤
Database

解決 Redis 6.0 升級後的 Connection Refused 錯誤

升級 Redis 到 6.0 後出現 Connection refused,原因是 bind 和 protected-mode 預設值變更,修改 redis.conf 這兩個設定即可恢復連線。

2020 年 7 月 21 日
English
Redis
Featured image of post 用 Blade 引擎 Render Markdown 並嵌入動態語法
Laravel

用 Blade 引擎 Render Markdown 並嵌入動態語法

透過 Blade addExtension 讓 .md 檔支援 @include 和變數,再交給 CommonMark 轉成 HTML,適合需要動態內容的文件系統。

2020 年 7 月 14 日
English
Laravel Blade Composer CommonMark
Featured image of post Windows 10 在 1GB 記憶體機器上的 5 項優化設定
Windows

Windows 10 在 1GB 記憶體機器上的 5 項優化設定

1GB 記憶體跑 Windows 10,關閉 Memory Compression、Superfetch、Defender、Ndu 等服務,用 PowerShell 指令大幅降低記憶體佔用。

2020 年 7 月 6 日
English
Windows
Featured image of post 如何把 Windows 10 安裝到 AWS EC2 上
Windows DevOps

如何把 Windows 10 安裝到 AWS EC2 上

用 VirtualBox 建立 Windows 10 VHD 映像,透過 AWS VM Import 匯入成 AMI,再啟動 EC2 執行個體,完整涵蓋 IAM 角色設定和 RDP 連線步驟。

2020 年 7 月 4 日
English
Windows AWS
Featured image of post Laravel 測試跟隨 Redirect:用 followingRedirects() 驗證最終頁面
Laravel Testing

Laravel 測試跟隨 Redirect:用 followingRedirects() 驗證最終頁面

POST 後只拿到 302 看不到最終頁面,用 followingRedirects() 自動跟隨轉址,直接對目標頁面做 assertion,並說明與舊版的差異。

2020 年 6 月 25 日
English
Laravel PHPUnit Testing
Featured image of post Laravel Feature 測試中偽造 $_SERVER 變數的 2 種方法
Laravel Testing

Laravel Feature 測試中偽造 $_SERVER 變數的 2 種方法

測試 IP 限制等依賴 $_SERVER 的邏輯時,可透過 get/post 方法的 server 參數單次傳入,或用 withServerVariables() 在整個測試方法內全域生效。

2020 年 6 月 23 日
English
Laravel Testing PHPUnit
Featured image of post 解決 Laravel Eloquent 大量資料處理時的 Memory Leak
Laravel

解決 Laravel Eloquent 大量資料處理時的 Memory Leak

Eloquent 每個 Model 實例都會快取載入的 relation,大量迴圈時記憶體持續攀升,呼叫 setRelations([]) 可手動清除快取釋放記憶體。

2020 年 6 月 18 日
English
Laravel Eloquent PHP
1 2 3 4 5
© 2020 - 2026 recca0120 技術筆記
recca0120 on GitHub
使用 Hugo 建立
主題 Stack 由 Jimmy 設計