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
<manifest> | |
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> | |
<application | |
android:allowBackup="true" | |
android:name=".WhateverApplication"> | |
<service android:name=".services.TrackerService" | |
android:foregroundServiceType="location" |
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 ( | |
"context" | |
//"database/sql" | |
"fmt" | |
"log" | |
"net" | |
"os" | |
"github.com/go-sql-driver/mysql" | |
"golang.org/x/crypto/ssh" |
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
private const val LAST_REQUEST_TIME_MILLISECONDS = "last_request_time_milliseconds" | |
private val getDateFormat = SimpleDateFormat("dd-hh-mm-ss") | |
private fun isRapidRequest(lastRequestDateTime: String): Boolean { | |
if (lastRequestDateTime.isBlank()) return false | |
val date = getDateFormat.format(Date()) | |
val dateTimeIntArrayList = date.split("-") | |
val lastDatetimeIntArrayList = lastRequestDateTime.split("-") |
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
inline fun <T> ArrayList<T>.filterAndUpdateList(predicate: (T) -> Boolean) : List<T> { | |
return filter(predicate = predicate).also { filteredList -> | |
this.clear() | |
this.addAll(filteredList) | |
} | |
} |
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 Modifier.velocityBouncePhysicsList( | |
scrollState: ScrollState): Modifier = composed { | |
if(scrollState.value == 0 || scrollState.value == scrollState.maxValue){ | |
val offsetY = remember { Animatable(0f) } | |
pointerInput(Unit) { | |
val decay = splineBasedDecay<Float>(this) | |
coroutineScope { | |
while (true) { | |
val pointerId = awaitPointerEventScope { awaitFirstDown().id } |
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
@ExperimentalAnimationApi | |
@Composable | |
fun EdufundBackConfirmationDialog( | |
componentParameter: ComponentParameter, | |
isDialogTypeBackConfirmation: Boolean, | |
title: String, | |
desc: String, | |
onYesClicked: () -> Unit, | |
onDismiss: () -> Unit, | |
testTag: String |
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
@ExperimentalAnimationApi | |
@ExperimentalPagerApi | |
@Composable | |
fun HorizontalPagerIndicator2( | |
pagerState: PagerState, | |
modifier: Modifier = Modifier, | |
activeColor: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current), | |
inactiveColor: Color = activeColor.copy(ContentAlpha.disabled), | |
indicatorHeight: Dp = 8.dp, |
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
@Composable | |
fun SomePage(){ | |
val animatedVisibility = produceState(initialValue = false){ | |
delay(2000) | |
value = true | |
} | |
BoxWithConstraints{ |
This file has been truncated, but you can view the full file.
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
# Copyright (c) 1993-2009 Microsoft Corp. | |
# | |
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. | |
# | |
# This file contains the mappings of IP addresses to host names. Each | |
# entry should be kept on an individual line. The IP address should | |
# be placed in the first column followed by the corresponding host name. | |
# The IP address and the host name should be separated by at least one | |
# space. | |
# |
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 text = mutableListOf("") | |
fun onValueChanged(value: String) { | |
if (!value.isName()) return | |
val filteredValue = value.replace("\\s+".toRegex(), " ") | |
if (value.contains("\n")) return | |
text.value = value | |
} |
NewerOlder