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
#include <iostream> | |
using namespace std; | |
struct record_t | |
{ | |
int id; | |
}; | |
void Mutable(record_t &record); |
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
"""Boto3 client response handler.""" | |
import boto3 | |
class ClientHandler: | |
"""Boto3 client response handler.""" | |
__slots__ = ["client", "method", "key", "paginator"] | |
def __init__(self, client, method, key): | |
"""Override.""" |
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
"""Boto3 client response handler.""" | |
import boto3 | |
class ClientHandler: | |
"""Boto3 client response handler.""" | |
__slots__ = ["client", "method", "key"] | |
def __init__(self, client, method, key): | |
"""Override.""" |
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
""" | |
MRO (Method Resolution Order) with multiple inheritance is resolved via | |
a linearization algorithm that flattens a tree. In some cases, super() | |
is not bound to a classes superclass, but instead to a sibling depending | |
on the object's MRO. | |
""" | |
class Base: | |
def __init__(self, field, **kwargs): |
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
"""Threading vs. Multiprocessing thread pools example.""" | |
import argparse | |
import logging | |
import multiprocessing.pool | |
import random | |
import threading | |
import time | |
logging.basicConfig( |
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
"""An example of procedurally generated music using FoxDot.""" | |
from atexit import register | |
from FoxDot import Clock, pluck, p1 | |
def fibonacci(n): | |
"""Get a list of numbers in the fibonacci sequence.""" | |
step = 1 if n >= 0 else -1 | |
seq = [0, 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
"""Playing with AWS Rekognition.""" | |
import argparse | |
import hashlib | |
import json | |
import logging | |
import boto3 | |
logging.basicConfig( |
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 unittest import mock | |
import thing | |
import pytest | |
@pytest.fixture() | |
def mock_client(monkeypatch, request): | |
"""Mock the client.""" |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Cloudformation Template | |
Parameters: | |
S3BucketParameter: | |
Description: S3 Bucket | |
Type: String | |
AliasParameter: | |
Description: CNAME (alternate domain names) |
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
'use strict'; | |
console.log('Loading function'); | |
exports.handler = async (event, context) => { | |
console.log('Received event:', JSON.stringify(event, null, 2)); | |
let responseBody = { | |
message: "This is a message", | |
input: event | |
}; |