2018年5月30日 星期三

ruby proc 可以傳default 值since ruby 1.9

所以

scope :latest, ->(size=5) { recent.limit(size) }

這樣是可以的

好廢的一篇文

呵呵

2018年5月29日 星期二

ssl-cookie-without-secure-flag-set


 HTTPOnly flag


https://portswigger.net/kb/issues/00500200_ssl-cookie-without-secure-flag-set

https://stackoverflow.com/questions/3773605/how-can-i-make-cookies-secure-https-only-by-default-in-rails



2018年5月25日 星期五

潮汐對浪大小的影響

還沒完全看懂,有空的時候可看一下

https://magicseaweed.com/news/are-waves-bigger-on-a-pushing-tide/10943/


各種 performance 相關的技巧 - rails related and general



https://www.monterail.com/blog/actionable-tips-to-improve-web-performance-with-rails


2018年5月24日 星期四

github issue 和 pr 帶不同 params 就有不同功能

潮潮的,可以指定 title, labels, template 和 assignees 之類的


https://help.github.com/articles/about-automation-for-issues-and-pull-requests-with-query-parameters/


Vue computed v.s. methods



computed 會 cached methods 不會
computed 回傳一個值,methods 不一定

https://cn.vuejs.org/v2/guide/computed.html

Rails 內建的加解密 MessageEncryptor


http://edgeapi.rubyonrails.org/classes/ActiveSupport/MessageEncryptor.html