Skip to content

Instantly share code, notes, and snippets.

View mohamedmenasy's full-sized avatar

Mohamed Nabil mohamedmenasy

View GitHub Profile
@mohamedmenasy
mohamedmenasy / KoinBenchmark.kt
Last active November 19, 2019 18:46
Koin DI Benchmark Code Snippet
fun measureTime(block: () -> Unit): Double = measureNanoTime(block) / 1000000.0
data class TestResult(
val startupTime: List<Milliseconds>,
val injectionTime: List<Milliseconds>
)
private fun runTest(
setup: () -> Unit,
test: () -> Unit,
teardown: () -> Unit = {}
@mohamedmenasy
mohamedmenasy / tizen_pedometer.js
Created June 20, 2016 23:23
Tizen Wearable Pedometer
window.onload = function() {
tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
// add eventListener for tizenhwkey
document.addEventListener('tizenhwkey', function(e) {
if (e.keyName === "back") {
try {
tizen.application.getCurrentApplication().exit();
} catch (ignore) {
}