This file contains 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
// I have confirmed to the point of using Firestore from AWS Lambda (node v18). | |
import admin from 'firebase-admin'; // version 11.10.1 | |
import { Credential } from 'firebase-admin/app'; | |
import { ComputeEngineCredential } from '../node_modules/firebase-admin/lib/app/credential-internal.js'; | |
import { ExternalAccountClient } from 'google-auth-library'; // version 9.0.0 | |
import fs from 'fs/promises'; | |
export class ExternalAccountCredential | |
extends ComputeEngineCredential // Inherits this class because it is verified to be an internal class at Firestore initialization. | |
implements Credential |
This file contains 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 { | |
Receiver, | |
ReceiverEvent, | |
ReceiverAckTimeoutError, | |
ExpressReceiverOptions, | |
} from '@slack/bolt' | |
import { ConsoleLogger } from '@slack/logger' | |
import { verifySignatureAndParseBody } from '@slack/bolt/dist/ExpressReceiver' | |
import express, { Application, RequestHandler, Request, Response, NextFunction } from 'express' | |
import axios from 'axios' |
This file contains 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
$ reviewdog -reporter=github-pr-check | |
reviewdog: status=401: The access token not provided. Get token from https://reviewdog.app/gh/line/line-bot-sdk-go | |
The command "reviewdog -reporter=github-pr-check" exited with 1. |
This file contains 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 | |
# Require: $ gcloud components install app-engine-go | |
gcloud="$(which gcloud)" | |
[ -L "$gcloud" ] && gcloud="$(readlink "$gcloud")" | |
appdir="$(dirname "$(dirname "$gcloud")")" | |
goapp="${appdir}/platform/google_appengine/goapp" | |
if ! [ -f "$goapp" ]; then | |
echo "goapp is not in the Google Cloud SDK libraries." >&2 | |
echo "Hint: try running this command:" >&2 |
This file contains 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
研修を踏まえてよかったこと、こうした方がいいと思うこと | |
- Heroku使ってたのはよかった | |
- 理想は好きなPaaSを選べるといいと思うので事前にヒアリングしてほしかった。 | |
- BOTを消すのはよくなかった。 | |
- 親や友達に自慢できるよう持って帰れるBOTがよさそう。 |
This file contains 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 linebot | |
import ( | |
"encoding/base64" | |
"encoding/json" | |
"net/http" | |
"net/url" | |
"os" | |
"golang.org/x/net/context" |
This file contains 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 ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"net/url" | |
"github.com/sergi/go-diff/diffmatchpatch" | |
) |
This file contains 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
$ GOMAXPROCS=1 GOROOT=~/src/github.com/golang/go go test -bench . | |
testing: warning: no tests to run | |
BenchmarkSort 30000 57616 ns/op | |
BenchmarkSlice 30000 43650 ns/op | |
PASS | |
ok github.com/k2wanko/sort-bench 38.994s | |
$ GOMAXPROCS=1 GOROOT=~/src/github.com/golang/go go test -bench . -benchmem | |
testing: warning: no tests to run | |
BenchmarkSort 20000 62222 ns/op 32 B/op 1 allocs/op |
This file contains 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
append | |
https://play.golang.org/p/5GEE7D2e8L | |
copy | |
https://play.golang.org/p/toSjy-DiEL | |
cut | |
https://play.golang.org/p/ebi-Idf-n- | |
delete |
This file contains 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 go run $0 $@ ; exit | |
package main | |
import "fmt" | |
func main() { | |
fmt.Print("Hello") | |
} |
NewerOlder