Skip to content

Instantly share code, notes, and snippets.

View wojtek-fliposports's full-sized avatar

Wojciech Bartosiak wojtek-fliposports

View GitHub Profile
@wojtek-fliposports
wojtek-fliposports / check-certs.sh
Last active January 20, 2020 09:21 — forked from chilledornaments/check-certs.sh
Bash SSL Certificate Expiration Check
#!/bin/bash
help_text(){
echo "Usage:"
echo " $0 HOSTNAME:PORT"
echo " HOSTNAME - target hostname to check"
echo " ECHO - target port. Default 443"
echo ""
echo "Env variables:"
echo " CERT_CHECK_SLACK_URL - Slack Webhook"
echo " CERT_CHECK_SLACK_USERNAME - Slack username"
@wojtek-fliposports
wojtek-fliposports / sendgrid_python_dynamic_template_data.py
Last active August 3, 2018 16:36 — forked from qgreg/sendgrid_python_dynamic_template_data.py
Sendgrid introduced dynamic templates, but hasn't released the feature in the Python SDK. Here's a bit of a path in the meantime.
""" Until Sendgrid updates the Python SDK to handle the new dynamic template data, you can use this Gist to
manage dynmaic template data in your python application.
The DynamicTemplateData is used to assign the key and value of the data, then NewPersonalizations is a subclass
of the existing Personalizations to which the DynamicTemplateData can be added.
This Gist takes inspiration from Sendgrid's Python SDK custom_args and CustomArgs.
Hopefully, other finds this useful and Sendgrid updates their Python SDK soon
"""
a = 2.2
b = 3.3
if 3*a == 6.6:
print("1")
elif 2*b == 6.6:
print("2")
else:
print("3")
class Fruit(object):
name = None
def __init__(self, name):
self.name = name
class FancyFruit(Fruit):
@classmethod
def fromString(cls, name):
return Fruit(name)