This file contains hidden or 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
| # in test/test_helper.exs | |
| ExUnit.configure(timeout: :infinity) | |
| ExUnit.start | |
| # ... | |
| # when using ecto change/add ownership timeout in config.exs | |
| config :myapp, MyApp.Repo, | |
| adapter: Ecto.Adapters.Postgres, # not important | |
| username: "mydatabaseuser", # not important | |
| database: "myapp_test", # not important |
This file contains hidden or 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
| case testvalue do | |
| n when n in [200, 400] -> | |
| true | |
| _ -> | |
| false | |
| end |
This file contains hidden or 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
| # Get CSR MD5 | |
| openssl req -noout -modulus -in my_csr.csr | openssl md5 | |
| # Get cert MD5 | |
| openssl x509 -noout -modulus -in my_cert.crt | openssl md5 | |
| # Get Key MD5 | |
| openssl rsa -noout -modulus -in my_key.key | openssl md5 |
This file contains hidden or 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
| class Post < ActiveRecord::Base | |
| after_commit :notify_editors, on: :create | |
| after_commit :generate_feed_item, on: :create | |
| private | |
| def notify_editors | |
| EditorMailer.send_notification(self).deliver_later | |
| end | |
| def generate_feed_item |
OlderNewer