有時因為營運上的需求,會需要在資料庫先行大量新增、更新或刪除某些資料,在迴圈外寫下 bind_param(),而不是在迴圈內每個執行回合裡寫下
read more有時因為營運上的需求,會需要在資料庫先行大量新增、更新或刪除某些資料,在迴圈外寫下 bind_param(),而不是在迴圈內每個執行回合裡寫下
read more在嘗試埋設追蹤使用者操作情況事件時,常會遇到尚未完成紀錄使用者操作事件,就被網頁轉址程式碼轉走的情形。解決方法之一,是讓轉址程式碼一定要在追
read moreDon’t refine coding style and debugging/adding functions in same time when you co-working with others. For example, you may change a php file from no standard applied to be PSR2. This is because it’s hard to know through git or other common diff tools what code you have changed even though you just remove redundant spaces or identations. I recommend teams, whose consider refining your own code for reducing tech
read moreI use many plugin with VIM to boost development when I writing and debugging programs, which are written through PHP and Ruby languages. Also there are few plugin for SASS, RSpec and Javascript. Below are configurations for my VIM editor and Vundle. There must some corresponded software be installed in the computer first and then these settings will work. nnoremap means normal mode in VIM. Usage of <silent> tag is
read more最近遇到使用 PHP 函式庫的 array_uintersect() ,去找出兩陣列有相同的元素,不過執行結果不如預期。目前仍未找到解法,希望藉寫下紀錄,提醒自己以後找到解法再回來補上。
read moreBelow 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 more