2015-03-31から1日間の記事一覧
def check true if hoge.present? && fuga.present? end ↑this above can be improved. def check hoge.present? && fuga.present? end Review AND, OR, XOR def hoge # AND false && false #=> false false && true #=> false true && false #=> false true…
In many cases, phantom.js is used to get screen capture. But wkhtmltoimage can be alternative. Install http://wkhtmltopdf.org/downloads.html $ sudo yum install -y openssl libX11 libXext libXext.so.6 $ cd /usr/local/src $ wget http://downlo…
to use bulk insert on Rails, add gem below. gem 'activerecord-import' In MySQL, bulk update can be used by this gem, but postgres..... sqlite..... update_all solution! # make all records with open: false to open: true Shop.where(open: fals…
to use bulk insert on Rails, add gem below. gem 'activerecord-import' In MySQL, bulk update can be used by this gem, but postgres..... sqlite..... update_all solution! # make all records with open: false to open: true Shop.where(open: fals…
In many cases, phantom.js is used to get screen capture. But wkhtmltoimage can be alternative. Install http://wkhtmltopdf.org/downloads.html $ sudo yum install -y openssl libX11 libXext libXext.so.6 $ cd /usr/local/src $ wget http://downlo…
def check true if hoge.present? && fuga.present? end ↑this above can be improved. def check hoge.present? && fuga.present? end Review AND, OR, XOR def hoge # AND false && false #=> false false && true #=> false true && false #=> false true…