This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phraseapp pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'base64' | |
aes = OpenSSL::Cipher::AES256.new(:CBC) | |
aes.encrypt | |
key = aes.random_key | |
iv = aes.random_iv | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's the public key given to me: `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl2uzoWA2iEGfeqDYO4XA0mQV8odb6qgdLT0T/k1PsbviMMt+SlAnZpwDkPlFySxNejOv8zAUHwDTWV7NGpYA0y+TrrBLkGGl9uUrzOjQLryJmFWsXxBGFd4emYXYBzROaH+r7pzhK7mIWLw1e2Cj5RL9Ac6wKA56axqCr2UZRNDBcS5A+nKTQTWy5eTrq6EQSBA6Hr81UWtYwlNSo1YbZ9JSNdD75Go7Du/zv1iPI+wWr7tMp0AJVBmieeB0kryXl+8zhli80wa72hDtyTkmfkBJAid5Il1biTrOXtMDaqXdfi9s4xzFp/ilP17KnA+VeAH2eLcqaC6LkEp/A1LApwIDAQAB` | |
I build a file with an extension of `.pem`, consisting of the public key in the following format: | |
-----BEGIN PUBLIC KEY----- | |
... | |
-----END PUBLIC KEY----- | |
After that, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Followings are the basic rules to follow while building for Rails platform. | |
1) Write the logic in appropriate component, and avoid creating god classes: classes with more than 100 lines of code. | |
2) Write the database related stuff in model, and view related stuff in views. Controllers' job should be to connect both. | |
3) If a model has too much functionality, create multiple modules, and include them inside a model, instead of filling the model with all the functionalty. | |
4) Try to keep the controllers skinny. | |
5) Write funtionality that is portable across Web components as well as API components. | |
6) Make sure that the routes are following the RESTful schema. Avoid having the words like CREATE, UPDATE, DESTROY in the routes. Use HTTP Verbs for these purposes. For more info: https://code.tutsplus.com/tutorials/a-beginners-guide-to-http-and-rest--net-16340 | |
7) Use the methods provided by Rails whereever it's possible. Avoid repeating too much code. | |
8) Use whitelisting the params, instead of manually assigning the p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
RedCloth (4.2.9) | |
actionmailer (3.2.21) | |
actionpack (= 3.2.21) | |
mail (~> 2.5.4) | |
actionmailer-with-request (0.4.0) | |
rails (>= 3) | |
actionpack (3.2.21) |