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
/** | |
* https://github.com/exozet/AndroidCore/blob/master/core/src/main/java/com/exozet/android/core/extensions/Dialog%2BExtenions.kt | |
*/ | |
abstract class BaseDialogFragment : DialogFragment() { | |
/** | |
* Current dialog layout. | |
*/ | |
@get:LayoutRes |
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
@OptIn(ExperimentalCoroutinesApi::class) | |
suspend fun Lifecycle.waitForLifecycleResumeEvent() = suspendCancellableCoroutine<Unit> { continuation -> | |
val observer = object : LifecycleObserver { | |
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME) | |
fun onResume() { | |
removeObserver(this) | |
continuation.resume(Unit) { | |
// it.printStackTrace() | |
} | |
} |
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 androidx.coordinatorlayout.widget.CoordinatorLayout | |
import com.google.android.material.appbar.AppBarLayout | |
import java.io.Closeable | |
class AppBarLayoutViewHolder(appBarLayout: AppBarLayout) : Closeable { | |
var expandable: Boolean = true | |
set(value) { | |
field = value | |
layout?.setExpanded(value) |
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 time | |
import datetime | |
import RPi.GPIO as GPIO | |
from collections import deque | |
counts = deque() | |
usvh_ratio = 0.00812037037037 # This is for the J305 tube | |
geigerChannel = 7 |
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/sh | |
set -o errexit | |
set -o nounset | |
set -o xtrace | |
export LANG=en_US.UTF-8 | |
export LANGUAGE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 |
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
<?xml version="1.0" encoding="utf-8"?> | |
<set | |
xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromYDelta="0%p" | |
android:toYDelta="100%p" /> | |
</set> |
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
#!/usr/bin/env bash | |
echo ">> Step: Extracting app version from versions.properties. <<" | |
if [ -f "version-properties.gradle" ]; then | |
APP_VERSION_RAW=$(grep "appVersion *=" version-properties.gradle) | |
else | |
echo "Could not detect version-properties.grade file, aborting..." | |
exit 1 | |
fi |
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
val a = listOf("a", "b", "c", "d") | |
val b = listOf("d", "e", "f", "a") | |
println("a=$a b=$b") // a=[a, b, c, d] b=[d, e, f, a] | |
println("combined ${a + b}") // combined [a, b, c, d, d, e, f, a] | |
println("union ${a.union(b)}") // union [a, b, c, d, e, f] | |
val ab = a.toMutableList() | |
ab.retainAll(b) | |
println("a retainAll b $ab") // a retainAll b [a, d] | |
val ba = b.toMutableList() | |
ba.retainAll(a) |
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 android.os.Binder | |
import android.os.Bundle | |
import android.os.Parcelable | |
import android.view.View | |
import androidx.core.app.BundleCompat | |
import androidx.fragment.app.Fragment | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
/** |
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
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist |