This file contains 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 json | |
import socket | |
import os | |
# Create a TCP/IP socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
# Connect the socket to the port where the server is listening | |
ip_address = os.getenv("TCP_SERVER_IP_ADDRESS") | |
port = int(os.getenv("TCP_PORT_NUMBER")) |
This file contains 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/python3 | |
from datetime import datetime | |
import json | |
from pprint import pprint | |
import socket | |
import os | |
from threading import Thread | |
import requests |
This file contains 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
openapi: 3.0.0 | |
info: | |
title: Loyalty Card API | |
version: "0.1" | |
components: | |
schemas: | |
User: | |
type: object | |
properties: | |
id: |
This file contains 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
exports.handler = (event, context, callback) => { | |
// Get the request object. | |
const request = event.Records[0].cf.request; | |
// Get the host from the request and take out "www." from the host if it exists. | |
let host = request.headers.host[0].value; | |
host = host.replace(/^www\./, ""); | |
// Check if the host contains a subdomain. |
This file contains 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
function evaluateChangeNotificationCompliance(configurationItem, ruleParameters) { | |
// boilerplate code, dont change | |
checkDefined(configurationItem, 'configurationItem'); | |
checkDefined(configurationItem.configuration, 'configurationItem.configuration'); | |
checkDefined(ruleParameters, 'ruleParameters'); | |
// check if the AWS Config rule that called this Lambda function | |
// defines the valid departments | |
if (ruleParameters.hasOwnProperty("validDepartments")) { | |
// pass |
This file contains 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
# Added support for merge messages | |
# Usage: | |
# git log | ruby git_commit_parser.rb | |
# https://gist.github.com/881641 | |
# By: Jason Amster | |
# jayamster@gmail.com | |
# Forked from: https://gist.github.com/jamster/881641 | |
require 'rubygems' | |
require 'pp' |