Skip to content

Instantly share code, notes, and snippets.

View Kaaveh's full-sized avatar
πŸ€“
Learning new technologies

Kaaveh Mohamedi Kaaveh

πŸ€“
Learning new technologies
View GitHub Profile
@erfansn
erfansn / PermissionsRequest.kt
Last active January 14, 2025 14:05
Convenient handling of runtime permissions in Jetpack Compose
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.content.SharedPreferences
import androidx.activity.compose.ManagedActivityResultLauncher
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.RowScope
import androidx.compose.material3.Button
import androidx.compose.material3.Text
@rock3r
rock3r / .gitignore
Last active April 13, 2024 12:52
A template .gitignore for Kotlin projects using Gradle (with additional content for Android projects)
## Seb's .gitignore template
# You can find the most up-to-date version at https://go.sebastiano.dev/gitignore
# Partly based on templates by https://plugins.jetbrains.com/plugin/7495--ignore
# Released under a CC-0 License https://creativecommons.org/share-your-work/public-domain/cc0/
### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
@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
@jamiesanson
jamiesanson / ViewLifecycleLazy.kt
Last active January 20, 2025 02:41
A Kotlin lazy implementation which automatically clears itself at appropriate times in the View Lifecycle, with a Fragment example
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
fun <T> Fragment.viewLifecycleLazy(initialise: () -> T): ReadOnlyProperty<Fragment, T> =
object : ReadOnlyProperty<Fragment, T>, DefaultLifecycleObserver {
@rickdaalhuizen90
rickdaalhuizen90 / .bashrc
Created February 12, 2017 17:20
Parrot Os bash theme for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
1 Precentral_L 255 128 255 255
2 Precentral_R 177 18 255 255
3 Frontal_Sup_L 45 255 47 255
4 Frontal_Sup_R 106 209 255 255
5 Frontal_Sup_Orb_L 122 255 158 255
6 Frontal_Sup_Orb_R 255 87 186 255
7 Frontal_Mid_L 183 150 54 255
8 Frontal_Mid_R 216 255 159 255
9 Frontal_Mid_Orb_L 181 169 80 255
10 Frontal_Mid_Orb_R 255 152 0 255
@vtanathip
vtanathip / gitignore-android-studio-list
Last active July 23, 2024 10:09
Git Ignore files list that should use in Android Studio Projects
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@rxaviers
rxaviers / gist:7360908
Last active June 9, 2025 12:04
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 9, 2025 17:48
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname