git cherry-pick 與 git show + git apply 與 git merge
如果是有部分的更改或新增功能,用 git merge 有時候不見得是好主意
如果是有部分的更改或新增功能,用 git merge 有時候不見得是好主意
如果是 api 的話,可以在程式的部分加上 header,但 resouce file (如圖片等)就得在 apache 裏頭做設定了
每年的2月1日是國際 frumint day。
整理一下留著以後應該還是會用到
還是要數據化一下…
exec() 最大的問題應該是,如果呼叫的 process 有print out 資料或其中有個 thread 有 return,都可能讓 exec() 以為 process 結束。
關鍵點在於不論是 XMLHttpRequest 或者是用 ajax,只要有夾帶 authroization (user name & password) 要做認證的話,會多一個 OPTIONS request,而且 javascript 這邊也要做修改。
其實還蠻簡單的,比較麻煩的反而是在產生 access key 這個部份,只能說 alibaba 的 document 有點難找 安裝與簡單的範例 安裝 sdk 可以直接到 https://github.com/aliyun/aliyun-oss-php-sdk下載。我自己是用 composer 裝完,可以在工作目錄的 vendor/aliyuncs/oss-sdk-php/ 底下找到 autoload.php 加到 php file 當中。開始使用的時候基本上只要 use OSSOssClient 與 OSSCoreOssException 這兩個 class 就差不多通吃了,下面這段是從 samples/ 目錄裡面的範例做修改的,可以作為參考。 <?php require_once ‘../vendor/aliyuncs/oss-sdk-php/autoload.php’; use OSSOssClient; use OSSCoreOssException; $accessKeyId = “YOUR_ACCESS_KEY_ID”; $accessKeySecret = “YOUR_ACCESS_KEY_SECRET”; $endpoint = “oss-cn-hongkong.aliyuncs.com”; $bucket = “YOUR_BUCKET_NAME”; try { /* build connection */ […]
Phalcon 的 model search 配合 paginator 就可以很方便地幫查詢資料結果做分頁,但是如果資料筆數過多,則會有速度過慢的問題。 dev tool 產生的程式碼與問題 原本用 phalcon-devtool 產生的 search 相關 volt 檔案與 controller 檔案大概會長這樣 <div class=”row”> <table class=”table table-bordered”> <thead> <tr> <th>Field A</th> <th>Field B</th> <th>Field C</th> <th></th> <th></th> </tr> </thead> <tbody> {% if page.items is defined %} {% for modelobjs in page.items %} <tr> <td>{{ modelobjs.fielda}}</td> <td>{{ modelobjs.fieldb}}</td> <td>{{ […]