Skip to content

Instantly share code, notes, and snippets.

View kichiemon's full-sized avatar
🌴
I’m on Fiji time!

terasaka kichiemon

🌴
I’m on Fiji time!
View GitHub Profile
} else if ([@"Firestore#settings" isEqualToString:call.method]) {
FIRFirestoreSettings *settings = [[FIRFirestoreSettings alloc] init];
if (![call.arguments[@"persistenceEnabled"] isEqual:[NSNull null]]) {
settings.persistenceEnabled = ((NSNumber *)call.arguments[@"persistenceEnabled"]).boolValue;
}
if (![call.arguments[@"host"] isEqual:[NSNull null]]) {
settings.host = (NSString *)call.arguments[@"host"];
}
if (![call.arguments[@"sslEnabled"] isEqual:[NSNull null]]) {
settings.sslEnabled = ((NSNumber *)call.arguments[@"sslEnabled"]).boolValue;
// The default cache size threshold is 100 MB. Configure "cacheSizeBytes"
// for a different threshold (minimum 1 MB) or set to "FirestoreCacheSizeUnlimited"
// to disable clean-up.
let settings = Firestore.firestore().settings
settings.cacheSizeBytes = FirestoreCacheSizeUnlimited
Firestore.firestore().settings = settings
@kichiemon
kichiemon / offline_firebase_auth.dart
Last active May 8, 2020 14:40
オフラインでもFirebaseAuthentication認証を通過させる
auth.currentUser.then((currentUser) => currentUser == null
? _authUserWithFirebase()
: Future.value(currentUser))
@kichiemon
kichiemon / firebase_cloud_functions_send_slack_when_purchased.ts
Created September 23, 2020 12:04
アプリ内課金の発生時にSlack通知する
import * as functions from "firebase-functions";
import * as request from "request";
exports.sendSlackMessageOnPurchaseCoin = functions
.region("asia-northeast1")
.analytics.event("in_app_purchase_coins")
.onLog((event) => sentMessageToSlack(event, "コインが購入されました"));
exports.sendSlackMessageOnPurchaseSubscription = functions
.region("asia-northeast1")
#!/usr/bin/env bash
# carthage.sh
# Usage example: ./carthage.sh build --platform iOS
set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
#!/bin/sh
# e.g. CONTAINER_REGISTRY=asia.gcr.io/your-project-name/gcf/asia-northeast1
CONTAINER_REGISTRY=`WRITE YOUR REGISTRY NAME`
IMAGE_LIST=`gcloud container images list --repository=$CONTAINER_REGISTRY | awk 'NR!=1'`
for line in $IMAGE_LIST; do
gcloud container images delete "$line/worker" --quiet & gcloud container images delete "$line/cache" --quiet &
done