- Get the max current value of a field (base on current data)
SELECT MAX(<field_name>) FROM <table_name>;
example:
SELECT MAX(id) FROM blogs;
SELECT MAX(<field_name>) FROM <table_name>;
example:
SELECT MAX(id) FROM blogs;
sudo adduser read_access
.. then enter your password for this user
Limit permission for the user (option) .. normally, this user only has root permission on it's directory. (/home/read_access)
Set read-only role for this user to use Postgresql
I. INTRO | |
- Only valids for TEST env | |
- All cards below have expiration dates and security codes: | |
| Expiration Date | CVV2 / CVC3 | CID (American Express) | | |
| 08/2018 | 737 | 7373 | | |
| 10/2020 | 737 | 7373 | | |
II. CARDS | |
= Mastercard | |
| Card Number | Card Type | Issuing Country | |
Config chung | |
Initializer | |
- Để các code khởi tạo trong thư mục config/initializers. Các đoạn code để trong thư mục này sẽ tự động execute khi server khởi động. | |
- Để các code khởi tạo thành các file riêng theo gem. Ví dụ: carrierwave.rb, devise.rb… | |
Global variable | |
- Các biến global như email dùng để gửi mail, hostname, … nên để trong các file config/enviroments/development.rb,config/enviroments/production.rb |
Optimize webpage speed: | |
- Tools: Google Pagespeed Insight, Gtmetrix.com, Webpagetest.org, Image Analysis of Webpagetest.org | |
- Tools mobile: Webpagetest.org, https://testmysite.thinkwithgoogle.com/ | |
1. Using sprite CSS for all images | |
2. Optimize images using tool Tinypng.com | |
3. Eliminate render-blocking JavaScript in above-the-fold content | |
- Use content_for custom js in Rails |