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
| from smtplib import SMTP_SSL | |
| from email.mime.text import MIMEText | |
| send_to = '[email protected]' | |
| # nu uita de active https://www.google.com/settings/security/lesssecureapps | |
| smtp_user = '[email protected]' | |
| smtp_pass = 'myfkpassword' |
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
| """ | |
| Singleton implementation | |
| """ | |
| class Singleton(type): | |
| _instances = {} | |
| def __call__(self, *args, **kwargs): | |
| if self not in self._instances: |
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 A(object): | |
| def x(self): | |
| print('A') | |
| class B(A): | |
| def x(self): | |
| super(B, self).x() | |
| print('B') |
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
| import datetime | |
| import subprocess | |
| import requests | |
| from dateutil import parser | |
| from_date = datetime.datetime(year=2019, month=4, day=24) | |
| a = subprocess.check_output(['pip', 'freeze']).decode('utf-8') |
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
| import sys | |
| import os | |
| print(sys.argv) | |
| with open(sys.argv[1], 'r') as f: | |
| content = f.read() | |
| with open(sys.argv[1], 'w') as f: | |
| f.write(content.replace(sys.argv[2], os.environ.get(sys.argv[2], ''))) |
OlderNewer