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
| gcloud auth application-default login \ | |
| --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets |
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
| #!/bin/bash | |
| # ログ出力用の関数(標準エラー出力に出力) | |
| log() { | |
| echo "$@" >&2 | |
| } | |
| # 現在の日時を取得(1週間前の日時計算に使用) | |
| current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| # 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
| #!/bin/bash | |
| set -o pipefail | |
| ORIGINAL_TABLE="User" | |
| TMP_TABLE="${ORIGINAL_TABLE}-$(date +%Y%m%d%H%M%S)" | |
| function wait_for_table_creation() { | |
| local table_name=$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
| resource "aws_cloudwatch_log_group" "sidekiq_stats" { | |
| name = "/aws/lambda/sidekiq-stats" | |
| retention_in_days = 7 | |
| } | |
| resource "aws_iam_role" "sidekiq_stats" { | |
| name = "sidekiq-stats" | |
| assume_role_policy = data.aws_iam_policy_document.sidekiq_stats_assume_role.json | |
| } |
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" | |
| "encoding/json" | |
| "fmt" | |
| "github.com/aws/aws-lambda-go/events" | |
| "github.com/aws/aws-lambda-go/lambda" | |
| "github.com/aws/aws-sdk-go-v2/aws" | |
| "github.com/aws/aws-sdk-go-v2/config" |
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
| SELECT | |
| "Actions Workflow" AS workflow, | |
| SUM(Quantity) AS sum | |
| FROM | |
| 'f1adc48a_2025-02-14_7.csv' | |
| WHERE | |
| Product = 'Actions' | |
| AND Date BETWEEN '2025-02-01' AND '2025-02-14' | |
| GROUP BY | |
| workflow |
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
| const HotelLocation = { | |
| Fukuoka: "Fukuoka", | |
| Odaiba: "Odaiba", | |
| Ariake: "Ariake", | |
| } as const; | |
| const locationCodeMap: LocationCode = { | |
| [HotelLocation.Fukuoka]: "FUKHIHI", | |
| [HotelLocation.Odaiba]: "TYOTOHI", | |
| [HotelLocation.Ariake]: "TYOARDI", |
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
| const configs: Configs = [ | |
| { | |
| location: HotelLocation.Odaiba, | |
| arrivalDate: new Date("2025-03-09"), | |
| departureDate: new Date("2025-03-10"), | |
| }, | |
| { | |
| location: HotelLocation.Ariake, | |
| arrivalDate: new Date("2025-03-09"), | |
| departureDate: new Date("2025-03-10"), |
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
| resource "google_service_account" "send_mail" { | |
| account_id = "send-mail" | |
| display_name = "send-mail" | |
| } | |
| resource "google_project_iam_member" "send_mail" { | |
| for_each = toset([ | |
| "roles/iam.serviceAccountTokenCreator", | |
| ]) |
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 sendMail | |
| import ( | |
| "bytes" | |
| "context" | |
| "encoding/base64" | |
| "encoding/json" | |
| "fmt" | |
| "cloud.google.com/go/pubsub" |
NewerOlder