BigBinary BlogWe craft blog posts about what we have learned so far and we have published 582 blog posts about Ruby on Rails, ReactJS, React Native, open source, engineering & design.
A lot of times, we ask user for sensitive data such as password, credit card number etc. We should not be able to see this information in logs. So, there must be a way in Rails to filter out these parameters from logs. Rails provides a way of doing this. We can add parameters to Rails.application.config.filter_parameters. There is one more way of doing this in Rails. We can also use https://api.ru
Recently, we faced a DDoS attack in one of the clients' projects. There were many requests from different IPs to root and login paths, and we were running thrice the usual number of servers to keep the system alive. We are using Cloudflare's HTTP proxy and it was doing a great job preventing malicious requests, but we wanted to check if we can avoid the loading/captcha pages which Cloudflare uses
We sometimes need unique and random tokens in our web apps. Here is how we typically build it. 1class User < ActiveRecord::Base 2 3 before_create :set_access_token 4 5 private 6 7 def set_access_token 8 self.access_token = generate_token 9 end 10 11 def generate_token 12 loop do 13 token = SecureRandom.hex(10) 14 break token unless User.where(access_token: token).exists? 15 end 16 end 17endCopy
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く