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
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/exec" |
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 | |
| set -euo pipefail | |
| source .env | |
| export PGHOST=localhost | |
| export PGDATABASE=my_db | |
| export PGUSER=dbuser | |
| export PGPASSWORD=${POSTGRES_PASSWORD} | |
| for sql in tests/*_test.sql; do |
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
| mock_message = MagicMock() | |
| mock_message.data = generate_mock_data() | |
| mock_receive_messages = MagicMock() | |
| mock_receive_messages.return_value.__aiter__.return_value = [(mock_receiver_client, mock_message)] | |
| mock_async_messaging_client.receive_messages = mock_receive_messages |
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
| // Package logconfig initializes a default application structured logger. | |
| package logconfig | |
| import ( | |
| "log/slog" | |
| "os" | |
| ) | |
| const ( | |
| ErrorKey = "err" |
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
| package someapp | |
| import ( | |
| "errors" | |
| "github.com/google/go-cmp/cmp" | |
| "reflect" | |
| "testing" | |
| ) | |
| // AssertEqual evaluates two equivalent types to see if a difference exists. |
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
| // Package retry supports retrying operations supported within the [RetryOperation] type set. | |
| package retry | |
| import ( | |
| "fmt" | |
| "log/slog" | |
| "os" | |
| "time" | |
| ) |
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 csv | |
| import sys | |
| def print_csv_stats(file_path: str): | |
| """Parses a CSV file and prints some info to stdout, including: | |
| - row count | |
| - column count | |
| - duplicate column count | |
| - populated column count |
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
| version: 1 | |
| disable_existing_loggers: false | |
| handlers: | |
| console: | |
| class: logging.StreamHandler | |
| formatter: json | |
| stream: ext://sys.stdout | |
| formatters: | |
| json: | |
| '()': pythonjsonlogger.jsonlogger.JsonFormatter |
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 | |
| # base resource directory for "file fixtures" (sample transactions) | |
| resources_directory = os.path.join( | |
| os.path.dirname(os.path.realpath(__file__)), | |
| "resources", | |
| ) |
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 ubi/ubi8 AS builder | |
| LABEL name="Awesome App" \ | |
| maintainer="Awesome Team" \ | |
| summary="The Awesome Application" \ | |
| vendor="Awesome Vendor" \ | |
| version=${buildnumber} \ | |
| description="A ubi8 base image with python39 installed and configured for managing the Awesome App." |
NewerOlder