Skip to content

Instantly share code, notes, and snippets.

View syossan27's full-sized avatar
💭
🤔

syossan27 syossan27

💭
🤔
View GitHub Profile
WITH numbered AS (
SELECT *, ROW_NUMBER() OVER (partition by summary_date order by timestamp desc) as rn
FROM `hoge-project.burndown_chart.day_results`
)
SELECT total_point, done_point, summary_date FROM numbered WHERE rn = 1 order by summary_date asc
func main() {
type item struct {
Title string
FieldValues struct {
Nodes []struct {
Value string
ProjectField struct {
Name string
}
}
DropdownButton<String>(
onTap: () {
if (selectedYear.value == 0) {
selectedYear.value = 1992;
// ドロップダウンリストが表示された後に"1992"を表示したいので
// 描画が終わればステートの変更を通知する
WidgetsBinding.instance?.addPostFrameCallback((_) => update());
}
},
import 'package:firebase_auth/firebase_auth.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
// アプリの初回起動チェック
// 初回起動ならログアウト
final prefs = await SharedPreferences.getInstance();
if (prefs.getBool('first_launch') ?? true) {
final FirebaseAuth auth = FirebaseAuth.instance;
await auth.signOut();
### 開発環境利用状況
| |dev1|dev2|dev3|
|:---:|:---:|:---:|:---:|
|App1|[![App1 - 1](https://storage.googleapis.com/[example-bucket]/app1/1.png)](https://https://asia-northeast1-[example-project].cludfunctions.net/redirect-url?env=app1&num=1)|[![App1 - 2](https://storage.googleapis.com/[example-bucket]/app1/2.png)](https://https://asia-northeast1-[example-project].cludfunctions.net/redirect-url?env=app1&num=2)|[![App1 - 3](https://storage.googleapis.com/[example-bucket]/app1/3.png)](https://https://asia-northeast1-[example-project].cludfunctions.net/redirect-url?env=app1&num=3)|
|App2|[![App2 - 1](https://storage.googleapis.com/[example-bucket]/app2/1.png)](https://https://asia-northeast1-[example-project].cludfunctions.net/redirect-url?env=app2&num=1)|[![App2 - 2](https://storage.googleapis.com/[example-bucket]/app2/2.png)](https://https://asia-northeast1-[example-project].cludfunctions.net/redirect-url?env=app2&num=2)|[![App2 - 3](https://storage.googleapis.com/[example-bucket]/app2/3.png)](https://https://asia-no
// 指定した開発環境にデプロイしたPR/Commitへ遷移
package p
import (
"context"
"io/ioutil"
"log"
"net/http"
"cloud.google.com/go/storage"
# 未使用に切り替えボタンが押下されたら指定されたアプリ/開発環境を未使用に変更
name: Change ENV by button
# repository_dispatchにより、外部から発火
# 参考URL: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#repository_dispatch
on:
repository_dispatch:
types: [change_env_1_by_button, change_env_2_by_button, change_env_3_by_button]
jobs:
// 指定した環境を未使用状態に切り替えるgithub actionsを実行し、リポジトリのトップへリダイレクト
package p
import (
"bytes"
"context"
"log"
"net/http"
"os"
# PRがマージ/クローズされたらデプロイした開発環境の使用状況を空に変更
name: Change ENV by Pull Request close
on:
pull_request_target:
# closedしか指定していませんが、マージ時も対象となります
types: [closed]
jobs:
change_env:
runs-on: ubuntu-latest
# PRに対して特定のコメントが作成されたら使用中に更新&デプロイタグをpush
# dev1へアプリ1をデプロイする部分のみ記述(本来はdev2, dev3も記述)
name: Deploy by Pull Request Comment
on:
issue_comment:
types:
- created
jobs:
deploy_by_pr_comment: