TL;DR
現在人大部分都會裝iterm2+zsh,而裝了zsh的關係,設定檔也會從.bashrc or .bash_profile變成.zshrc。 今天要討論的就是萬一把.zshrc的PATH改壞了,而且又source它發生憾事的時候,該如何處理? 首先當下一定會看到類似這個狀況:
開門見山的說,用 {} 的寫法運行起來是完全一樣的,舉例:
$a = 2;if ($a == 1) {} elseif ($a == 2) {}
vs
$a = 2;if ($a == 1) {} else if ($a == 2) {}
以下範例的程式碼都在github上。 https://github.com/keepgoing147/docker-php7-apache-mysql 安裝好docker之後,新建一個資料: test,cd 到test,新增docker-compose.yml,並新增以下code:
之前都使用最新的php版本7.1.0,不過一直在beta版。
今天試著brew upgrade了一下,發現beta變成RC5了。
咦,RC5是什麼意思?趕緊查一下wiki! beta版的意思是產品已經差不多開發完成了,可以開放給部分的使用者用用看,以公司來講的話,通常會給一些公司的熟顧客或是親戚好友之類的使用,看看哪邊還要改進的,像silicon valley主角的公司發的邀請函一樣,請大家給點意見。…
這篇獻給需要急需要讓網頁呈現非同步刷新的人員而又沒時間學習優秀的framework的開發人員。 非同步刷新的意思是在一個網頁上,再刷新的時候只會有一個部分更新,而其他的部分不變,例如當使用者輸入搜尋字串,接著按下搜尋的時候,畫面上會有一個區塊專門顯示搜尋結果,而其他部分像選單、頁頭、頁尾之類的都不會受到更動,以下來示範如何用很簡單的方式跟後台取得資料並渲染在網頁上。 這次要使用的技術為ajax,要使用這項技術必須引用JQuery,接著才能使用ajax的程式語法:
新知:
需研究:
在設計一個系統時,低耦合是其中一個目標,當需求出現,對之前已運行很穩定的程式碼變動越少越好,低耦合意味著能夠在這樣的前提之下,也能相對容易得去擴充新功能。
PHP的interface是一個很不錯的低耦合考慮因素。
情況:需要寫一個會員紅利產生判斷 一開始先設好MemberCoin的interface,然後令大家都會用到的function,但是這裡有任何實作,感覺有點像是我來訂一個標準,每個有implements我的都統一用這個function實作吧!
今天拜讀了张云龙大神的大作,讓我對前端開發大開眼界,以往的網頁流程是: 前端切版->丟給後端實作功能->完成 前端跟後端沒有建立一個工程化的機制,所以傳統的檔案架構是js統一放在js/,css統一放在css/和網站上的圖片通通都放在images/,看起來很乾淨整齊,但對於開發人員來講好處就真的只是乾淨整齊而已。
These were the top 10 stories published by Hong’s Technical Blogs; you can also dive into yearly archives: 2016, 2017, and 2018.