Below execution environment is at Ubuntu 14 LTS. rvm cron setup #sm start rvm example PATH="/usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/rvm/bin" GEM_HOME='/usr/local/rvm/gems/ruby-2.3.0' GEM_PATH='/usr/local/rvm/gems/ruby-2.3.0:/usr/local/rvm/gems/ruby-2.3.0@global' MY_RUBY_HOME='/usr/local/rvm/rubies/ruby-2.3.0' IRBRC='/usr/local/rvm/rubies/ruby-2.3.0/.irbrc' RUBY_VERSION='ruby-2.3.0' #sm end rvm example change from shell to bash shell SHELL=/bin/bash # you definie your own crontab job 0 0 * * * . $HOME/.profile; cd /directory/you/want/toexecute; ruby /path/to/yourfile.rb parameter1 parameter2 ...etc > /dev/null 0 1 * * * . $HOME/.profile; cd /directory/you/want/toexecute; ruby /path/to/yourfile.rb `date -d "yesterday" "+%F"`
read moreSituation: After trying to use slick plugin of jquery using log-in user, I want to sign out. The screen shows 'No routes matches '/users/sign_out' ' when I click the link of sign-out. Before trying slick plugin, /users/sign_out route of devise gem works as normal. Cause: The addtional js jquery-migrate-min, which required for slick plugin, makes rails misunderstood original route for /users/sign_out . Environment: Rails 4.2.5.1, Devise 3.5.5, Jquery-migrate-rails 1.2.1 Solution:
read moreThis article works for both of production and development environment and not like other articles only work for development. The tested environment are Rails 4.2.5.1, Ruby 2.3.0, Doorkeeper 3.1.0, Grape 0.14.0, Grape-kaminari 0.1.8, Wine_Bouncer 0.5.1 and Devise 3.5.5 . 1. Sample configuration for Grape gem in Rails app projects. 列出Grape gem的設定檔範例 In config/application.rb, add below two
read moreFrom this link: http://stackoverflow.com/questions/27411581/centering-no-captcha-recaptcha/29836372?sgp=2#29836372, I have learned how to use css to position No Captcha reCaptcha at horizonal center inside a page. Belows are sass-syntax code. .your-recaptcha-class display: inline-block text-align: center inline-block means to represent your element to be text-feature and block-feature. Its format wouldn’t generate a new line with other elements itself and it’s also to be configured with padding, width, heigth, background-image attributes, …, etc. Extra reference about
read moreWe 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