add contrib

This commit is contained in:
Martin Cech 2016-11-29 13:19:06 -05:00 committed by GitHub
parent 5e2713bc81
commit 3d4b47e03c

View File

@ -13,7 +13,7 @@ The file [whitelist.conf](whitelist.conf) gathers email domains that are often i
Example Usage Example Usage
============= =============
Python **Python**
```Python ```Python
blacklist = ('disposable_email_blacklist.conf') blacklist = ('disposable_email_blacklist.conf')
blacklist_content = [line.rstrip() for line in blacklist.readlines()] blacklist_content = [line.rstrip() for line in blacklist.readlines()]
@ -23,7 +23,7 @@ if email.split('@')[1] in blacklist_content:
else: else:
return True return True
``` ```
PHP contributed by @txt3rob and @deguif **PHP** contributed by @txt3rob and @deguif
```php ```php
function is_temp_mail($mail) { function is_temp_mail($mail) {
$mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
@ -32,7 +32,7 @@ function is_temp_mail($mail) {
return in_array(explode('@', $mail)[1], $mail_domains_ko); return in_array(explode('@', $mail)[1], $mail_domains_ko);
} }
``` ```
Ruby on Rails **Ruby on Rails** contributed by @MitsunChieh
In resource model, usually it is `user.rb` In resource model, usually it is `user.rb`
```Ruby ```Ruby