Skip to content

Instantly share code, notes, and snippets.

View berhram's full-sized avatar
🎸
Rock'n'Roll

Daniil Pechorin berhram

🎸
Rock'n'Roll
  • Novi Sad, Serbia
View GitHub Profile
@JakeSteam
JakeSteam / ItemAdapter.kt
Last active April 22, 2024 09:56
Creating a grid RecyclerView with quick drag and drop item swapping, Room / LiveData support, and more!
class ItemAdapter(
private val itemClickListener: (OwnedItem) -> Unit,
private val itemSaver: (List<OwnedItem>) -> Unit
) : RecyclerView.Adapter<ItemViewHolder>() {
val items = ArrayList<OwnedItem>()
fun setItems(newItems: List<OwnedItem>) {
val result = calculateDiff(newItems)
items.clear()
@EugeneTheDev
EugeneTheDev / DotsLoaders.kt
Created March 18, 2021 23:15
Dots loading animations with Jetpack Compose
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@handstandsam
handstandsam / MyLifecycleOwner.kt
Last active January 30, 2025 02:47
Jetpack Compose OverlayService. You have to have all the correct permissions granted and in your manifest, but if you do, this this will show a green box with "Hello" in it!
import android.os.Bundle
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleRegistry
import androidx.savedstate.SavedStateRegistry
import androidx.savedstate.SavedStateRegistryController
import androidx.savedstate.SavedStateRegistryOwner
internal class MyLifecycleOwner : SavedStateRegistryOwner {
private var mLifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this)
private var mSavedStateRegistryController: SavedStateRegistryController = SavedStateRegistryController.create(this)
Big O complexities for common methods of Java Collections and common sorting algorithms.
Complexity (Best to Worst)
===================================================================================================
O(1) < O(log n) < O(n) < O(n log n) < O(n^2) < O(2^n) < O(n!)
Collections
===================================================================================================
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active April 24, 2025 19:40
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default