Skip to content

Instantly share code, notes, and snippets.

View KoheiKanagu's full-sized avatar
🏠
Working from home

KoheiKanagu KoheiKanagu

🏠
Working from home
View GitHub Profile
limactl create --name docker-vz --vm-type "vz" --rosetta --network vzNAT --mount-type "virtiofs" --mount "~/Develop:w" template://docker
Future<void> loadAppFonts() async {
final fontManifest = await rootBundle.loadStructuredData(
'FontManifest.json',
(string) async => json.decode(string) as Iterable<dynamic>,
);
for (final e in fontManifest) {
final loader = FontLoader(
(e as Map<String, dynamic>)['family'] as String,
);
#!/bin/bash
set -euxo pipefail
BUNDLE_ID=dev.kingu.bundleId # FIXME: change to your bundle ID for iOS
PACKAGE_NAME=dev.kingu.package_name # FIXME: change to your package name for Android
[email protected] # FIXME: change to your Google account
PROJECT_NAME_DEV=project-name-dev # FIXME: change to your project name
PROJECT_NAME_PROD=project-name-prod # FIXME: change to your project name
class CustomSliverPersistentHeader extends SingleChildRenderObjectWidget {
const CustomSliverPersistentHeader({
super.key,
required super.child,
});
@override
RenderObject createRenderObject(BuildContext context) =>
_RenderCustomSliverPersistentHeader();
}
#!/bin/bash
set -euxo pipefail
echo '
[
{
"name": "delete_all",
"action": {
"type": "Delete"
},
@KoheiKanagu
KoheiKanagu / auto_merge.yaml
Created May 31, 2023 04:49
PRのワークフローが完了した際に`auto_merge`というタグがあればマージする
name: Auto Merge
on:
workflow_run:
workflows:
- Pull Requests
types:
- completed
concurrency:
@KoheiKanagu
KoheiKanagu / pub_get.yaml
Created May 12, 2023 01:46
pubのdependabotがpubspec.lockのsha256を削除してしまうため、pub getしてコミットするGithub Actionsのワークフロー
name: pub get
on:
pull_request:
paths:
- packages/**/pubspec.yaml
- packages/**/pubspec.lock
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@KoheiKanagu
KoheiKanagu / github-actions-oidc.sh
Last active November 13, 2024 08:40
GitHub ActionsでFirebase CLIを利用する際にOpenID Connectを利用して認証するための下準備スクリプト
#!/bin/bash
set -exo pipefail
while [[ "$#" -gt 0 ]]; do
case $1 in
--project-id=*) PROJECT_ID="${1#*=}" ;;
--github-repo-name=*) GITHUB_REPO_NAME="${1#*=}" ;;
--github-repository-owner=*) GITHUB_REPOSITORY_OWNER="${1#*=}" ;;
*)
echo "Usage: $0 --project-id=kingu-42 --github-user-name=KoheiKanagu --github-repo-name=kingu_dev"
// ignore_for_file: depend_on_referenced_packages
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart';
import 'package:flutter_test/flutter_test.dart';
// https://github.com/firebase/flutterfire/issues/3311#issuecomment-721414988
void setupFirebaseAppMocks() {
TestWidgetsFlutterBinding.ensureInitialized();
MethodChannelFirebase.channel.setMockMethodCallHandler(
#!/bin/bash
set -euxo pipefail
# https://github.com/flutter/flutter/labels
gh label create "P0" --description "Priority 0 issue such as a build break or regression." --color "#FF0000"
gh label create "P1" --description "Priority 1 issue likely blocking a tier-1 customer now." --color "#DD0000"
gh label create "P2" --description "Priority 2 issue likely blocking a tier-1 customer soon." --color "#AA0000"
gh label create "P3" --description "Priority 3 issue (the default for issues we're likely to work on after P0-P2 issues)" --color "#990000"
gh label create "P4" --description "Priority 4 issue (default for bugs, things we're likely to work on)" --color "#770000"