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
| <?php | |
| //from email can be set in the relevant curl_setopt below. | |
| //for my purposes, I was always using the same from email and didn't need one more variable to pass into this function. | |
| // | |
| function send_mail($email,$subject,$msg,$mailDomain,$api) { | |
| $curl = curl_init(); | |
| curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
| curl_setopt($curl, CURLOPT_USERPWD, 'api:'.$api_key); | |
| curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); |
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
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Author : Vitor Rodrigues Di Toro | |
| # E-Mail : vitorrditoro@gmail.com | |
| # Date : 14/03/2018 | |
| # Last Update : 19/03/2018 | |
| # | |
| import unittest |
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
| def plural_days(n): | |
| days = ['день', 'дня', 'дней'] | |
| if n % 10 == 1 and n % 100 != 11: | |
| p = 0 | |
| elif 2 <= n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20): | |
| p = 1 | |
| else: | |
| p = 2 |
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
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |
OlderNewer