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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style type="text/css"> | |
| .square_spacer { | |
| width: 300px; | |
| background-color: steelblue; | |
| border: solid; | |
| position: relative; |
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
| .center-vertical-horizontal{ | |
| margin: 0; | |
| position: absolute; | |
| /* top and left define the position of the object relative to the parent in | |
| dimensions of the parent.*/ | |
| top: 50%; | |
| left: 50%; | |
| /* transform translate shifts the element aways from the defined position | |
| in dimensions of it self. That means these 50% are 50% of the element sizes | |
| them selfs.*/ |
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 logging | |
| logger = logging.getLogger(__name__) | |
| # Log level is INFO. So anything of lower level (DEBUG) should not execute | |
| logger.setLevel(logging.INFO) | |
| stream_handler = logging.StreamHandler() | |
| logger.addHandler(stream_handler) |
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
| # -*- coding: utf-8 -*- | |
| """Checking the return of random number generator.""" | |
| from random import random | |
| def random_avgerage(trails): | |
| """Return average of a given number of randomly generated numbers.""" |
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
| # -*- coding: utf-8 -*- | |
| """Trying to create a singleton.""" | |
| class Singleton(object): | |
| """The public class.""" | |
| instance = None |
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
| print(" NO AGRUMENTS ".center(30, "#")) | |
| def this_adds_decoration(function_to_decorate): | |
| def this_creates_decoration(): | |
| print("Before") | |
| function_to_decorate() | |
| print("After") | |
| # Return the created decoration to add it to a function |
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 os | |
| import time | |
| from sshtunnel import SSHTunnelForwarder | |
| # Set the environment variable that contains the passphrase for the given | |
| # private key file. | |
| KEY_PASSPHRASE = os.environ.get("SSH_PRIVATE_KEY_PASSPHRASE") |
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
| * { | |
| box-sizing: border-box; | |
| font-family: 'Helvetica Neue', Arial, sans-serif; | |
| } | |
| html, | |
| body, | |
| h1, | |
| h2, |
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
| # -*- conding: uft-8 -*- | |
| """Just playing around with the class init method.""" | |
| class InitReturnNone(): | |
| def __init__(self, var): | |
| self.var = var | |
| return None |
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 here: https://github.com/sendgrid/sendgrid-python#quick-start | |
| import os | |
| from sendgrid import SendGridAPIClient | |
| from sendgrid.helpers.mail import Mail | |
| message = Mail( | |
| from_email='alice@example.com', | |
| to_emails='bob@example.com', | |
| subject='Sending with Twilio SendGrid is Fun', |
OlderNewer