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 "list" | |
| a: [{id: 1}, {id: 2}] | |
| b: [{id: 1}, {id: 1}] | |
| c: [{id: 1}, {id: 2}, {id: 2}] | |
| a_ids:: [x.id for x in a] | |
| a_unique: list.UniqueItems(a_ids) | |
| unique :: { |
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
| CREATE TEMP FUNCTION typeof_literal(input STRING) | |
| AS ( | |
| CASE | |
| -- Process NUMERIC, DATE, DATETIME, TIME, TIMESTAMP, | |
| WHEN REGEXP_CONTAINS(input, r'^[A-Z]+ "') THEN REGEXP_EXTRACT(input, r'^([A-Z]+) "') | |
| WHEN REGEXP_CONTAINS(input, r'^-?[0-9]*$') THEN 'INT64' | |
| WHEN REGEXP_CONTAINS(input, r'^(-?[0-9]+[.e].*|CAST\("([^"]*)" AS FLOAT64\))$') THEN 'FLOAT64' | |
| WHEN input IN ('true', 'false') THEN 'BOOL' | |
| WHEN input LIKE '"%' THEN 'STRING' | |
| WHEN input LIKE 'b"%' THEN 'BYTES' |
Test about The backing indexes of Cloud Spanner Foreign Keys.
Tested at GCPUG Shared Spanner on 2020-03-10.
CREATE TABLE Referenced (
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
| curl -s https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-amd64/Packages | | |
| gojq -srR 'def ver: split("-")[0]; | |
| split("\n\n") | | |
| map(gsub("\n "; " ") | | |
| split("\n") | | |
| map(capture("^(?<key>[A-Z][a-zA-Z-]*): (?<value>.*)$"; "")) | | |
| from_entries) | | |
| group_by(.Package) | | |
| map({key: .[0].Package, value: (sort_by(.Version))}) | | |
| from_entries | |
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" | |
| "flag" | |
| "cloud.google.com/go/datastore" | |
| "github.com/k0kubun/pp" | |
| "log" |
Follow official gRPC example https://knative.dev/docs/serving/samples/grpc-ping-go/
GCP_PROJECT="your-own-project"
git clone -b "release-0.9" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/grpc-ping-go
gcloud builds submit --tag "gcr.io/${GCP_PROJECT}/grpc-ping-go"
gcloud beta run deploy --image=gcr.io/${GCP_PROJECT}/grpc-ping-go --allow-unauthenticated --platform=managed --region=asia-northeast1 grpc-ping
$ gcloud iam service-accounts create callee
$ gcloud iam service-accounts create caller
$ gcloud builds submit -t gcr.io/${PROJECT_ID}/oidctest .
$ gcloud beta run deploy --image=gcr.io/${PROJECT_ID}/oidctest --allow-unauthenticated \
--service-account=caller@${PROJECT_ID}.iam.gserviceaccount.com caller
$ gcloud beta run deploy --image=gcr.io/${PROJECT_ID}/oidctest --no-allow-unauthenticated \
--service-account=callee@{PROJECT_ID}.iam.gserviceaccount.com callee