Skip to content

Instantly share code, notes, and snippets.

View frogggias's full-sized avatar
🎯

Tomáš Šůstek frogggias

🎯
View GitHub Profile
@frogggias
frogggias / gitmirror.sh
Last active June 19, 2023 11:08
Mirror git repository (BB to GitHub migration)
BB_REPO_SSH_URL=
GITHUB_REPO_SSH_URL=
LOCAL_FOLDER=ghm
# Cleanup
if [ -d ${LOCAL_FOLDER} ]; then
rm -rf ${LOCAL_FOLDER}
fi
git clone --mirror ${BITBUCKET_REPO_SSH_URL} ${LOCAL_FOLDER}
# git -C ${LOCAL_FOLDER} lfs fetch --all # Uncomment for LFS support
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.ir.util.IrUtilsKt.copyValueParametersToStatic(IrUtils.kt:898)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:241)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:236)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:68)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:55)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:43)
@frogggias
frogggias / LongClickHackBox.kt
Last active April 1, 2023 17:45
Hacky solution to handle at least some onLongClick events on M3 Button
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
@Composable
fun LongClickHackBox(
onClick: (() -> Unit)?,
onLongClick: (() -> Unit)?,
@frogggias
frogggias / FairyTaleTest.kt
Created March 16, 2023 22:49
GenZ fairy tale unit test by GPT4
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
class FairyTaleTest {
@Test
fun `Once upon a time in a lit kingdom`() {
val kingdom = Kingdom("Vibeland")
val princess = InfluencerPrincess("Ava", followers = 100_000)
kingdom.addInhabitant(princess)
@frogggias
frogggias / IntentPrettyPrint.kt
Last active October 18, 2022 22:11
Kotlin extension for pretty print of Android Intent
fun Intent.prettyPrint(): String = buildString {
append("Intent {")
val values = listOf<Pair<String, String?>>(
"action" to action,
"data" to data.toString(),
"type" to type,
"component" to component?.flattenToString(),
"flags" to flags.toString(),
"package" to `package`,
"categories" to categories?.joinToString(","),