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 | |
| # | |
| # SlothServ Bootstrap | |
| # Sets up the entire media server stack on a fresh macOS machine. | |
| # | |
| # Usage: | |
| # bash bootstrap.sh # Interactive — prompts for everything | |
| # bash bootstrap.sh --import config.json # Headless — reads saved credentials | |
| # bash bootstrap.sh --export config.json # Snapshot — dumps live stack to file | |
| # |
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
| """ | |
| SlothServ watchdog daemon. | |
| Run as: python3 -m watchdog (from scripts/) | |
| or: python3 scripts/watchdog (from media-server/) | |
| """ |
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
| class PhoneNumberVisualTransformation(locale: Locale = Locale.getDefault()) : VisualTransformation { | |
| private val phoneNumberFormatter = | |
| PhoneNumberUtil.getInstance().getAsYouTypeFormatter(locale.country) | |
| override fun filter(text: AnnotatedString): TransformedText { | |
| phoneNumberFormatter.clear() | |
| var formatted = "" |
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
| data class NutritionDateWithFoodItemsEntity( | |
| @Embedded val nutritionDate: NutritionDateEntity, | |
| @Relation( | |
| parentColumn = "epochDay", | |
| entityColumn = "createdAt", | |
| associateBy = Junction(NutritionDateAndFoodItemCrossRefEntity::class) | |
| ) | |
| val foodItems: List<FoodItemEntity> | |
| ) |
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 Modifier.repeatingClickable( | |
| interactionSource: MutableInteractionSource, | |
| enabled: Boolean, | |
| maxDelayMillis: Long = 1000, | |
| minDelayMillis: Long = 5, | |
| delayDecayFactor: Float = .20f, | |
| onClick: () -> Unit | |
| ): Modifier = composed { | |
| val currentClickListener by rememberUpdatedState(onClick) |
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
| @Preview | |
| @Composable | |
| fun CustomRepeatingButton() { | |
| Box(modifier = Modifier.fillMaxSize()) { | |
| var repeatCount by remember { mutableStateOf(0) } | |
| val interactionSource = remember { MutableInteractionSource() } | |
| Surface( | |
| modifier = Modifier | |
| .repeatingClickable( |
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 Modifier.repeatingClickable( | |
| interactionSource: InteractionSource, | |
| enabled: Boolean, | |
| maxDelayMillis: Long = 1000, | |
| minDelayMillis: Long = 5, | |
| delayDecayFactor: Float = .20f, | |
| onClick: () -> Unit | |
| ): Modifier = composed { | |
| val currentClickListener by rememberUpdatedState(onClick) |
NewerOlder