Skip to content

Instantly share code, notes, and snippets.

View fabriciovergara's full-sized avatar

Fabricio Vergara fabriciovergara

View GitHub Profile
@fabriciovergara
fabriciovergara / RememberNavResult.kt
Last active February 16, 2024 22:57
Compose KMP For Result
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Stable
import androidx.compose.runtime.State
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.mutableStateMapOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.Saver
import androidx.compose.runtime.saveable.SaverScope
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.animate
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.with
import androidx.compose.foundation.background
@fabriciovergara
fabriciovergara / CollapsibleTopAppBar.kt
Last active January 23, 2024 17:06
Collapsible TopAppBar in Jetpack Compose
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
@fabriciovergara
fabriciovergara / gist:70a53ece6e6eda150b21760235ff2bcb
Created April 27, 2022 11:31
Fix for Macbook Swedish Keyboard to US
# bashrc, profile or zshrc
echo "Replacing § key by ` and ~"
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' > /dev/null
@fabriciovergara
fabriciovergara / pubspec_base_sync.py
Created February 17, 2022 15:50
Flutter: Sync pubspec file in melos project with flavors
import sys
import glob
import ruamel.yaml
yaml = ruamel.yaml.YAML()
def main():
# python3 pubspec_base_sync.py ../pubspec_base_android.yaml ../pubspec_base_android_huawei.yaml
@fabriciovergara
fabriciovergara / BitMask.kt
Last active August 24, 2021 07:23 — forked from jimschubert/.gitignore
BitMask for Enum in Kotlin 1.5+
package utils
import utils.BitMask.Companion.enabledEnumValues
import utils.BitMask.Companion.contains
import utils.BitMask.Companion.plus
import utils.BitMask.Companion.toBitMask
@JvmInline
value class BitMask(val value: Long) {
@fabriciovergara
fabriciovergara / Index.js
Created March 5, 2017 10:48
React-Navigation AuthFlow with Saga
import React from 'react'
import { connect } from 'react-redux'
import { redirect as redirectAction } from 'src/redux/auth/action';
class Index extends React.Component {
static propTypes = {
redirect: React.PropTypes.func.isRequired,
};