濫用.length嘅悲劇


更新咗1.3.1一段時間後,有一日我想幫幾篇舊文章修改少少嘢先發現,個分頁位爛咗。

消失的分頁欄。

佢第一頁係會有分頁欄,但係第二頁打後嘅會消失。我望一望Chrome console又無報錯......

TL;DR,抽絲剝繭後發現原來係我用咗.length黎計Object size出事。雖然唔知點解佢計到第一頁,但係之後嘅都死晒。當我喺第一頁用console.log(object.length)嗰陣會出5,之後其他頁面係undefined。於是就上網搵返正確計算object size嘅方法,並將object.length個位改返做Object.keys([OBJECT_NAME]).length...

呢個故事教訓我,啲JS嘅basis真係要打返好啲... -___-

PHP Composer異常地慢


新手如我,喺初初用composer嘅時候成日都會覺得佢郁得好慢。composer install或者composer create-project都還好,但一用到composer update就好似成個網絡爆炸咗咁,次次都起碼等一分鐘以上;如果你整緊嘅嘢已經require咗一堆packages就更加耐啦。

[71.3MB/1500.77s] Downloading https://packagist.org/p/provider-2017-07%24adda4f38383325b5cc891e193f119392d14f6d2d7fe9ecd3636ec8be07f7f7d5.json


  [Composer\Downloader\TransportException]
  The "https://packagist.org/p/provider-2017-07%24adda4f38383325b5cc891e193f119392d14f6d2d7fe9ecd3636ec8be07f7f7d5.json" file could not be downloaded (HTTP/1.1 404 Not Found)
尋日我面對嘅狀況...當然呢個係因為composer嗰邊出咗問題所以先咁,但實際上每次更新都等咗我分幾鐘。

結果尋晚出咗問題後,我喺Laravel台灣嘅群組度發問,有人就介紹咗個package俾我。


簡單黎講就係composer嘅平衡下載/安裝用插件。如果本身無網絡問題嘅話,呢個plugin真係幫到唔少忙架。

Powered by Half-moon Production.

Copyright © 2011-2020 by 泣雨家的雜物房. Version 1.5.2.

濫用.length嘅悲劇


更新咗1.3.1一段時間後,有一日我想幫幾篇舊文章修改少少嘢先發現,個分頁位爛咗。

消失的分頁欄。

佢第一頁係會有分頁欄,但係第二頁打後嘅會消失。我望一望Chrome console又無報錯......

TL;DR,抽絲剝繭後發現原來係我用咗.length黎計Object size出事。雖然唔知點解佢計到第一頁,但係之後嘅都死晒。當我喺第一頁用console.log(object.length)嗰陣會出5,之後其他頁面係undefined。於是就上網搵返正確計算object size嘅方法,並將object.length個位改返做Object.keys([OBJECT_NAME]).length...

呢個故事教訓我,啲JS嘅basis真係要打返好啲... -___-

PHP Composer異常地慢


新手如我,喺初初用composer嘅時候成日都會覺得佢郁得好慢。composer install或者composer create-project都還好,但一用到composer update就好似成個網絡爆炸咗咁,次次都起碼等一分鐘以上;如果你整緊嘅嘢已經require咗一堆packages就更加耐啦。

[71.3MB/1500.77s] Downloading https://packagist.org/p/provider-2017-07%24adda4f38383325b5cc891e193f119392d14f6d2d7fe9ecd3636ec8be07f7f7d5.json


  [Composer\Downloader\TransportException]
  The "https://packagist.org/p/provider-2017-07%24adda4f38383325b5cc891e193f119392d14f6d2d7fe9ecd3636ec8be07f7f7d5.json" file could not be downloaded (HTTP/1.1 404 Not Found)
尋日我面對嘅狀況...當然呢個係因為composer嗰邊出咗問題所以先咁,但實際上每次更新都等咗我分幾鐘。

結果尋晚出咗問題後,我喺Laravel台灣嘅群組度發問,有人就介紹咗個package俾我。


簡單黎講就係composer嘅平衡下載/安裝用插件。如果本身無網絡問題嘅話,呢個plugin真係幫到唔少忙架。