Skip to content

Instantly share code, notes, and snippets.

View tahaak67's full-sized avatar
💭
Have a wonderful day

Taha Ben Ashur tahaak67

💭
Have a wonderful day
View GitHub Profile
@maio
maio / plugin.kts
Created August 21, 2025 10:35
Open build.gradle.kts IntelliJ IDEA action (Live Plugin)
// https://gist.github.com/maio/70353d23877ccc3e6c54e86f042fd891
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.vfs.VirtualFile
import liveplugin.PluginUtil.registerAction
import liveplugin.PluginUtil.show
@elyesmansour
elyesmansour / NonRecomposingSizeModifiers.kt
Created March 11, 2025 22:55
Jetpack Compose size modifiers that skip recomposition
package com.elyesmsr.sizemodifier
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.layout
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.constrain
// Usage
// PingPongSwitch(
// textFirst = "Ping",
// textSecond = "Pong"
// )
@Composable
fun PingPongSwitch(
state: PingPongSwitchState = rememberPingPongSwitchState(),
textFirst: String,
@handstandsam
handstandsam / MyLifecycleOwner.kt
Last active November 24, 2025 20:12
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)
@c33k
c33k / Update .gitignore
Last active June 5, 2025 05:08
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."