wbkuo 發表在 痞客邦 留言(0) 人氣(17)
git diff e630759 HEAD --name-only | xargs zip diff.zip
wbkuo 發表在 痞客邦 留言(0) 人氣(177)
格式如下
<a href="xxx.zip" download target="_blank">xxx.zip</a>
wbkuo 發表在 痞客邦 留言(0) 人氣(36)
$ find . -type f -atime +7 | xargs rm
wbkuo 發表在 痞客邦 留言(0) 人氣(53)
雖然 query cache 可以提升效能,但如果在測試 API 效能的時候反而會造成困擾,可以用以下語法來清除 query cache
1. RESET QUERY CACHE;
2. FLUSH QUERY CACHE;
wbkuo 發表在 痞客邦 留言(0) 人氣(1,615)
方法1 (直接用 find 搜尋整個目錄)
$ find ./ -name \*.php -exec grep -wl '<<<<<<< HEAD' {} \;
方法2 (更新的時候,順便檢查兩個 commit 之間的異動)
$ git diff a57b997..ae47664 | grep '+<<<<<<< HEAD'
wbkuo 發表在 痞客邦 留言(0) 人氣(20)
問題
這個問題是因為在 ubuntu 不知道哪一版開始,預設會把 php 刪除 session 的動作關掉
然後系統會自行使用 /usr/lib/php/sessionclear 的命令來清除 session
但預設刪除的是 sess_* 的檔案
但 CodeIgniter 3 產生的 session 檔案為 ci_session* 的檔案
所以 session 會一直留在目錄裡面,直到 目錄的 index 爆掉為止
筆記
session 預設目錄: /var/lib/php/sessions
session 刪除檔案的命令: /usr/lib/php/sessionclear
PHP 原生的 session 檔名: SESS_*
Codeigniter 3 建立的 session 檔名: ci_session*
wbkuo 發表在 痞客邦 留言(0) 人氣(153)
1. 先使用 git reflog 查看剛才你還沒 push 的 commit 在哪
$ git reflog
b846b19 HEAD@{0}: reset: moving to origin/hotfix_#467_fix_email_reveal
ebe56b3 HEAD@{1}: checkout: moving from c50a74fa95aa586738946320a2d6bd013a4fb0e6 to ebe56b3c1cb256e2c07c34db9d5c6a3aff60240c
c50a74f HEAD@{2}: checkout: moving from hotfix_#467_fix_email_reveal to c50a74fa95aa586738946320a2d6bd013a4fb0e6
b846b19 HEAD@{3}: checkout: moving from 9f137318cee420484b7e1c3b70c16ab1debab782 to hotfix_#467_fix_email_reveal
9f13731 HEAD@{4}: checkout: moving from hotfix_#467_fix_email_reveal to 9f13731
b846b19 HEAD@{5}: checkout: moving from 9f137318cee420484b7e1c3b70c16ab1debab782 to hotfix_#467_fix_email_reveal
9f13731 HEAD@{6}: commit: 8787878787
4acb037 HEAD@{7}: checkout: moving from hotfix_#467_fix_email_reveal to 4acb037117557efe4b451fd3af4a7a3fad6a61d4
2. 再下 git checkout 到你消失的 commit (例 87878787)
$ git checkout 9f13731
Previous HEAD position was b846b19... [Feature] - #467 - hide commit message
HEAD is now at 9f13731... 8787878787
wbkuo 發表在 痞客邦 留言(0) 人氣(21)
第一次看到,快速做個筆記。
function isMatch($url) {
$rx = '~
^([a-z]+) # 註解1
([0-9]+)$ # 註解2
~x';
return preg_match($rx, $url);
}
isMatch("111222333");
// false
isMatch("aaabbccc");
// false
isMatch("a1");
// true
isMatch("abc123");
// true
wbkuo 發表在 痞客邦 留言(0) 人氣(48)
1. 顯示 schema
SHOW COLUMNS FROM `TABLE_NAME`;
wbkuo 發表在 痞客邦 留言(0) 人氣(34)