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
#!/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 |
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
#!/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 |
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
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") |
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
auth.currentUser.then((currentUser) => currentUser == null | |
? _authUserWithFirebase() | |
: Future.value(currentUser)) |
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
// 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 |
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
} 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; |
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
@override | |
Future<void> settings({ | |
bool persistenceEnabled, | |
String host, | |
bool sslEnabled, | |
int cacheSizeBytes, | |
}) async { | |
await channel.invokeMethod<void>('Firestore#settings', <String, dynamic>{ | |
'app': app.name, | |
'persistenceEnabled': persistenceEnabled, |
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
Navigator.push( | |
context, | |
new MaterialPageRoute( | |
builder: (BuildContext context) => NextPage(), | |
fullscreenDialog: true, | |
), | |
) |
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
fun <A, B> LiveData<A>.combineLatestWith(other: LiveData<B>): LiveData<Pair<A, B>> { | |
val mediator = MediatorLiveData<Pair<A, B>>() | |
mediator.addSource(this) { | |
it?.let { thisValue -> | |
other.value?.let { otherValue -> | |
mediator.value = Pair(thisValue, otherValue) | |
} | |
} | |
} | |
mediator.addSource(other) { |
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
grep -R "Content-Type\': undefined" ./* -l | xargs sed -i -e 's|Content-Type\\\': undefined|Content-Type\\\': \'application/x-www-form-urlencoded;application/json;charset=utf-8\'|g |
NewerOlder