We could classify objects of javascript or JSON ones to different groups based on their attributes' values. I modified original example as below coffeescript code from Reference link. Suppose you have an array-variable of JSON objects and a variable of Object, and you want to classify or group them based on values of their date attributes. warehouseOfClassifiedJSONObj = new Object(); arrayOfJSONObj = [ {name:"taro", date:"1996-01-01", total_average_price: 50}, {name: "flower", date:
read more今年一月偶然在活動之都墨爾本的海信體育館現場看澳網公開賽Australia open,澳網公開賽在Richmond train station附近的三個鄰
read more寫了一陣子的英文部落格文章,這篇用中文書寫調劑一下。Postgres 在 8.3 版之後的版本開始提供全文搜尋功能,資料表上若沒加上 tsvector 的欄位,每次查詢
read moreI use following codes and tools to debug files of CoffeeScript/JavaScript: Safari browser’s developer tool set breakpoints at debugger tab of javascript files responsive design mode of developer tool can help us to see what a web page is rendered. coffeescript code if myVariable? # this statement can check whether this variable has its value(s), null or undefined. If it has value, this statement would return true, otherwise false. alert
read moreFollow below code for inquiring ones in ActiveRecord between two dates: YourModel.find(:date => somenumber.days.ago..Date.today) # or YourModel.find(:created_at => yourNumber.years.ago..Date.today) # or YourModel.find(:updated_at => yourVariable.months.ago..Date.yesterday) Aboved code are modified from a post at stackoverflow.com. Reference: http://stackoverflow.com/questions/2381718/rails-activerecord-date-between
read moreUse below command to start/restart/stop the postgresql easily: brew services start postgresql brew services restart postgresql brew services stop postgresql Reference: How to start postgreSQL server on mac os x? http://stackoverflow.com/a/24251522/2704360
read more