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
# https://github.com/astral-sh/uv-docker-example/blob/main/multistage.Dockerfile | |
# use base python image with uv pre-installed | |
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder | |
ARG WORK_DIR=/app | |
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy | |
WORKDIR ${WORK_DIR} | |
COPY pyproject.toml ${WORK_DIR}/pyproject.toml |
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 datetime import datetime, timedelta | |
def daterange(date1, date2): | |
date_range = list() | |
for n in range(int ((date2 - date1).days)): | |
tmp = date1 + timedelta(n) | |
date_range.append(tmp.strftime('%Y-%m-%d')) | |
return date_range | |
current_date = datetime.today() | |
last_week_start = current_date - timedelta(days=7) |
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
# returns number of partitions per broker | |
kafka-log-dirs.sh --describe --bootstrap-server localhost:9092 --topic-list ${topic_name} --describe | grep '^{' | jq '[.brokers[] | {broker:.broker, partition_count:[.logDirs[].partitions[]] | length}]' | jq 'sort_by(.partition_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
kafka-log-dirs.sh --describe --bootstrap-server localhost:9092 --topic-list ${topic_name} --describe | grep '^{' | jq '[.brokers[] | {broker:.broker, size:[.logDirs[].partitions[].size] | add}]' | less |
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 scala.collection.mutable | |
case class DataServiceLookup( | |
app_name: String, | |
lookup_keys: mutable.Map[String, Any], | |
data: mutable.Map[String, Any] | |
) |
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 org.apache.flink.streaming.api.functions.sink.RichSinkFunction | |
import org.apache.flink.streaming.runtime.tasks.{ProcessingTimeService,ProcessingTimeCallback} | |
import org.apache.flink.streaming.api.operators.StreamingRuntimeContext | |
import org.apache.flink.api.common.state.{ValueState, ValueStateDescriptor} | |
class RichSinkFactUpcoming extends RichSinkFunction[FulfillmentUsagesOutput] with ProcessingTimeCallback { | |
@transient var processingTimeService: ProcessingTimeService = _ |
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
/** | |
* Reads the items.txt file and returns an inventory object | |
* | |
* @return | |
* @throws IOException | |
*/ | |
public Inventory ReadToolFile() throws IOException { | |
Inventory theInventory = new Inventory(); | |
try { |
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 View; | |
import javax.swing.*; | |
import java.awt.*; | |
/** | |
* The type Search panel. | |
*/ | |
public class SearchPanel extends JPanel { | |
private JRadioButton clientIdButton; |
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' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Description: github handler | |
Outputs: | |
GithubHandlerApiURL: | |
Description: "API Prod stage endpoint" | |
Value: !Sub "https://${ApiGatewayApi}.execute-api.${AWS::Region}.amazonaws.com/prod/" | |
Resources: | |
ApiGatewayApi: | |
Type: AWS::Serverless::Api |
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: Template creates Codebuild resources for a simple SAM Application | |
Resources: | |
SamCodeBuild: | |
Type: AWS::CodeBuild::Project | |
Properties: | |
Name: sam-deployment-v2 | |
Description: Build process for a simple Python HelloWorld Application deployed using AWS SAM | |
ServiceRole: !GetAtt CodeBuildIAMRole.Arn | |
Artifacts: |
NewerOlder