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 August 8, 2023 11:33
Convenient handling of runtime permissions in Jetpack Compose
@Composable
fun PermissionsRequestButton(
permissions: List<String>,
onGranted: () -> Unit,
modifier: Modifier = Modifier,
onRationaleShow: (List<String>) -> Unit = { },
onPermanentlyDenied: (List<String>) -> Unit = { },
onPartiallyGranted: (List<String>) -> Unit = { },
content: @Composable RowScope.() -> Unit,
) {
@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 March 26, 2024 13:17
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 git@github.com: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 May 26, 2021 09:12
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 May 6, 2024 11:18
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 May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname