Avatar 💻

recca0120 Tech Notes

Software Developer / Tech Notes

  1. Home
  2. Archives
  3. Categories
  4. Tags
  5. Search
  6. About
    1. Dark Mode

Archives

2026 3
2024 3
2023 11
2022 13
2020 15
More

Categories

Laravel PHP Testing Database DevOps Frontend MacOS Windows

Tags

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 Loses Lazy Evaluation with Generator
Laravel PHP

Laravel LazyCollection Loses Lazy Evaluation with Generator

Passing a Generator directly to LazyCollection causes iterator_to_array to expand it all at once. Wrap it in a Closure to restore true lazy evaluation.

2020 年 8 月 17 日
正體中文
Laravel PHP
Featured image of post GuzzleHttp getContents() Returns Empty on the Second Call
PHP

GuzzleHttp getContents() Returns Empty on the Second Call

Casting a GuzzleHttp Response to string auto-seeks to 0, but getContents() never resets the pointer, so the second call returns empty. Always rewind manually.

2020 年 8 月 5 日
正體中文
Guzzle PSR-7 PHP
Featured image of post Connect Bluetooth on a Headless Raspberry Pi via CLI
DevOps

Connect Bluetooth on a Headless Raspberry Pi via CLI

Use bluetoothctl scan, pair, trust, and connect to pair Bluetooth devices on a headless Raspberry Pi without a desktop and auto-reconnect on every reboot.

2020 年 7 月 21 日
正體中文
Raspberry Pi Bluetooth Linux
Featured image of post Fix Redis Connection Refused After Upgrading to 6.0
Database

Fix Redis Connection Refused After Upgrading to 6.0

Redis 6.0 changed the defaults for bind and protected-mode, causing Connection refused errors. Adjust two settings in redis.conf to restore connectivity.

2020 年 7 月 21 日
正體中文
Redis
Featured image of post Render Markdown with Blade and Embed Dynamic Syntax
Laravel

Render Markdown with Blade and Embed Dynamic Syntax

Use Blade addExtension to make .md files support @include and variables, then pass the output through CommonMark to generate HTML for dynamic documentation.

2020 年 7 月 14 日
正體中文
Laravel Blade Composer CommonMark
Featured image of post Run Windows 10 on 1GB RAM: 5 PowerShell Optimizations
Windows

Run Windows 10 on 1GB RAM: 5 PowerShell Optimizations

Disable Memory Compression, Superfetch, Windows Defender, and Ndu via PowerShell to significantly reduce RAM usage and run Windows 10 on just 1GB of memory.

2020 年 7 月 6 日
正體中文
Windows
Featured image of post How to Install Windows 10 on AWS EC2 via VM Import
Windows DevOps

How to Install Windows 10 on AWS EC2 via VM Import

Build a Windows 10 VHD in VirtualBox, import it to AWS as an AMI using VM Import, and launch an EC2 instance. Covers IAM role setup, S3 upload, and RDP login.

2020 年 7 月 4 日
正體中文
Windows AWS
Featured image of post Laravel Testing: Assert Final Page Content After a Redirect
Laravel Testing

Laravel Testing: Assert Final Page Content After a Redirect

POST requests only return a 302, hiding the final page. Use followingRedirects() to automatically follow redirects and assert on the destination page content.

2020 年 6 月 25 日
正體中文
Laravel PHPUnit Testing
Featured image of post 2 Ways to Fake $_SERVER Variables in Laravel Feature Tests
Laravel Testing

2 Ways to Fake $_SERVER Variables in Laravel Feature Tests

Fake $_SERVER in Laravel feature tests by passing server vars per-request, or use withServerVariables() to apply them globally for the entire test method.

2020 年 6 月 23 日
正體中文
Laravel Testing PHPUnit
Featured image of post Fix Laravel Eloquent Memory Leak with Large Datasets
Laravel

Fix Laravel Eloquent Memory Leak with Large Datasets

Eloquent caches loaded relations on every Model instance, causing memory to climb in large loops. Call setRelations([]) on each iteration to release the cache.

2020 年 6 月 18 日
正體中文
Laravel Eloquent PHP
1 2 3 4 5
© 2020 - 2026 recca0120 Tech Notes
recca0120 on GitHub
Built with Hugo
Theme Stack designed by Jimmy