[WordPress] 使用 file_get_contents() 讀取文件
在使用 PHP 開發 WordPress 外掛(plugin)的過程中,我們總少不了開檔、將檔案讀取進來的動作。而在這之中,以 file_get_contents() 最為常見。
在使用 PHP 開發 WordPress 外掛(plugin)的過程中,我們總少不了開檔、將檔案讀取進來的動作。而在這之中,以 file_get_contents() 最為常見。
Given theRead More »LeetCode: 938-Range Sum of BST 解題紀錄rootnode of a binary search tree and two integerslowandhigh, return the sum of values of all nodes with a value in the inclusive range[low, high].
The power of the string is the maximum length of a non-empty substring that contains only one unique character. Given a string s, return the power of s.Read More »LeetCode: 1446-Consecutive Characters
在 WordPress 外掛(plugin)開發的過程中,由於 WordPress 使用了 Settings API 簡化了開發者對於資料庫的讀寫,所以我們可以很便利地使用 register_setting()、get_option()、update_option() 等等的函式來將一些外掛的屬性資料儲存在資料庫中。
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.
Return the decimal value of the number in the linked list.
Read More »LeetCode: 1290-Convert Binary Number in a Linked List to Integer在使用 cp 或是 rsync 等指令複製檔案後,為了確保複製的過程中沒有出現問題,我會習慣性地使用 du 指令去查看文件的大小。
幾乎所有的 Debian/Ubuntu 系 Linux 發行版的使用者,都會使用 apt 或是 apt-get 指令來管理自己的套件(packages),甚至有些使用者還會誤認這兩個指令是相同的。
在 WordPress 網站中存在著圖片上傳的尺寸上限,為了能夠方便地上傳(或是順利地顯示出來),將大容量的圖片以不破壞太多圖像品質的進行壓縮是一件非常重要的事情。
Read More »[工具] 使用 TinyPNG 線上免費工具壓縮圖片