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 to create resources for Amazon Bedrock model invocation logging | |
Parameters: | |
SystemName: | |
Type: String | |
Default: brmil | |
Description: Name of the system for which the resources are being created. | |
EnvType: | |
Type: String |
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
"""Utilities for iCalendar (ICS) data.""" | |
from datetime import datetime | |
from zoneinfo import ZoneInfo | |
import recurring_ical_events # type: ignore[reportMissingTypeStubs] | |
from aws_lambda_powertools import Logger | |
from icalendar import Calendar | |
logger = Logger() |
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
"""Unit tests for twilio_signature_validator module.""" | |
import base64 | |
import pytest | |
from aws_lambda_powertools.event_handler.exceptions import ( | |
BadRequestError, | |
UnauthorizedError, | |
) | |
from aws_lambda_powertools.utilities.data_classes import LambdaFunctionUrlEvent |
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
#!/usr/bin/env python | |
import logging | |
import time | |
from functools import wraps | |
from typing import Any, Callable | |
def log_execution_time(func: Callable[..., Any]) -> Callable[..., Any]: | |
@wraps(func) |
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
#!/usr/bin/env python | |
import logging | |
from typing import Optional | |
import boto3 | |
from pydantic import BaseModel, model_validator | |
from typing_extensions import Self | |
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
#!/usr/bin/env python | |
import signal | |
import time | |
import pyautogui | |
def press_esc_repeatedly(waiting_sec=300, pressed_key='esc'): | |
signal.signal(signal.SIGINT, signal.SIG_DFL) |
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
#!/usr/bin/env python | |
import argparse | |
import bz2 | |
import gzip | |
import logging | |
import os | |
from pathlib import Path | |
from pprint import pformat |
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
#!/usr/bin/env python | |
import bz2 | |
import gzip | |
from Bio import SeqIO | |
def read_fasta(path): | |
if path.endswith('.gz'): |
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
#!/usr/bin/env bash | |
# | |
# Usage: ./git_rewind_days.sh <int> | |
set -eux | |
DAYS_TO_REWIND="${1}" | |
COMMIT_DATE=$(git log -1 | sed -ne 's/^Date: \+//p') | |
REWIDED_DATE=$(date -d "${COMMIT_DATE% *} - ${DAYS_TO_REWIND} days" | awk '{print $1" "$2" "$3" "$4" "$6}')" ${COMMIT_DATE##* }" |
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
#!/usr/bin/env bash | |
# | |
# https://github.com/dceoy/ansible-dev/blob/master/roles/ruby/files/install_rbenv.sh | |
set -uex | |
RBENV_DIR="${HOME}/.rbenv" | |
RB_BUILD_DIR="${HOME}/.rbenv/plugins/ruby-build" | |
RBENV="${RBENV_DIR}/bin/rbenv" | |
[[ ${#} -ge 1 ]] && RB_MAJOR_VER="${1}" || RB_MAJOR_VER=2 |
NewerOlder