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
{ | |
"@@locale": "en", | |
"helloWorld": "Hello World", | |
"@helloWorld": { | |
"description": "The conventional newborn programmer greeting" | |
}, | |
"hello": "Hello {world}", | |
"@hello": { |
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
var orginalCallback; | |
void main() { | |
runApp(...); | |
orginalCallback = window.onReportTimings; | |
window.onReportTimings = onReportTimings; | |
} | |
const maxframes = 60; | |
final lastFrames = ListQueue<FrameTiming>(maxframes); |
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
// ignore_for_file: public_member_api_docs | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:provider/single_child_widget.dart'; | |
/// A provider that exposes a [ValueNotifier] in two independent pieces. | |
/// | |
/// [StoreProvider] will expose both [ValueNotifier] and [ValueNotifier.value] independently | |
/// to its dependents. |
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 kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.setMain | |
import org.junit.jupiter.api.extension.AfterAllCallback | |
import org.junit.jupiter.api.extension.AfterEachCallback | |
import org.junit.jupiter.api.extension.BeforeAllCallback | |
import org.junit.jupiter.api.extension.ExtendWith | |
import org.junit.jupiter.api.extension.ExtensionContext |
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
diff --git a/app/build.gradle b/app/build.gradle | |
index d1b7792..dd96f56 100644 | |
--- a/app/build.gradle | |
+++ b/app/build.gradle | |
@@ -47,3 +47,15 @@ dependencies { | |
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' | |
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' | |
} | |
+ | |
+ |
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
public class OwnPushService extends FirebaseMessagingService { | |
private List<FirebaseMessagingService> messagingServices = new ArrayList<>(2); | |
public GCPushService() { | |
messagingServices.add(new AirshipFirebaseMessagingService()); | |
messagingServices.add(new TLFirebaseMessagingService()); | |
} |
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
fun encrypt(context:Context, strToEncrypt: String): ByteArray { | |
val plainText = strToEncrypt.toByteArray(Charsets.UTF_8) | |
val keygen = KeyGenerator.getInstance("AES") | |
keygen.init(256) | |
val key = keygen.generateKey() | |
saveSecretKey(context, key) | |
val cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING") | |
cipher.init(Cipher.ENCRYPT_MODE, key) | |
val cipherText = cipher.doFinal(plainText) |
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
fun <T> Class<Any>.invoke(methodName: String , vararg args: Pair<Class<*>, *>): T? { | |
return try { | |
getMethod(methodName, *(args.map { it.first }.toTypedArray())) | |
?.invoke(this, *(args.map { it.second }.toTypedArray())) as? T | |
} catch (e: Throwable) { | |
e.printStackTrace() | |
null | |
} | |
} |
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 | |
<< //// | |
The script creates 'licenses' under '$ANDROID_HOME' and creates a file which proves | |
that the SDK license was accepted by the user. | |
Please copy this to your own account/gist/server. Every time there's an updated license, update the file with the new | |
license hash. | |
Legally if you run this script (or your own version of it), it means YOU accepted the license - don't trust someone else. | |
The hashes below are supposed to be taken from $ANDROID_HOME/licenses/android-sdk-license on YOUR machine, after you |