Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos / SpotlightOverlay.kt
Last active February 12, 2026 15:36
SpotlightOverlay
/*
* Copyright 2025 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ardakazanci
ardakazanci / Parallax.kt
Created August 7, 2025 18:29
Jetpack Compose Parallax Concept
@Composable
fun Modifier.parallaxHeader(
listState: LazyListState,
headerHeightDp: Dp,
maxStretchFactor: Float = 3.0f,
pullMultiplier: Float = 1.5f,
onHeightChanged: (Dp) -> Unit
): Modifier {
val density = LocalDensity.current
val coroutineScope = rememberCoroutineScope()
@ardakazanci
ardakazanci / HeartLove.kt
Created June 2, 2025 06:54
Press L for Love Jetpack Compose
@Composable
fun FloatingHeartsAnimation() {
var showHearts by remember { mutableStateOf(false) }
val heartList = remember { mutableStateListOf<Int>() }
var sliderValue by remember { mutableFloatStateOf(0.5f) }
val scale = remember { Animatable(1f) }
val scope = rememberCoroutineScope()
val config = HeartConfig(
radiusMultiplier = lerp(0.5f, 2f, sliderValue),
@KlassenKonstantin
KlassenKonstantin / EmojiBg.kt
Created November 16, 2024 10:07
EmojiBg in KMP
@Composable
fun EmojiFont() = FontFamily(
Font(Res.font.noto_emoji_light, FontWeight.Light),
Font(Res.font.noto_emoji_reg, FontWeight.Normal),
Font(Res.font.noto_emoji_med, FontWeight.Medium),
)
val testEmojis =
persistentListOf("🍇", "🍅", "🥬", "🍞", "🧀", "🥚", "🥩", "🍫", "🍕", "🍷", "🧃", "🧼", "🧻", "🧴", "🍏")
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
ColorPickerTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
@dellisd
dellisd / Test.kt
Created June 9, 2022 16:37
Explicit Backing Fields
class Test {
val names: List<String>
field: MutableList<String> = mutableListOf<String>()
fun doThing() {
names.add("Hello!")
}
}
fun main() {
@spacepatcher
spacepatcher / Breach Compilation (1.4 billion credentials) in Postgres.md
Last active February 12, 2026 18:51
Breach Compilation (1.4 billion credentials) in Postgres.md
@layerlre
layerlre / IDCardUtil.java
Created March 27, 2017 06:25
Validate thai ID card
public class IDCardUtil {
public static boolean isValid(String idCard){
if (idCard.length()!=13){
return false;
}
int sum = 0;
for (int i = 0; i < 12; i++) {
sum += Character.getNumericValue(idCard.charAt(i))*(13-i);
}