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
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
javascript: | |
var global = window; | |
global.COPY_TO_CLIPBOARD = global.COPY_TO_CLIPBOARD || {}; | |
global.COPY_TO_CLIPBOARD.getUrl = function () { | |
let url = new URL(location.href); | |
url.searchParams.set("hl", "en"); | |
return url.href; | |
}; |