Skip to content

Instantly share code, notes, and snippets.

Avatar
🐨
https://feresr.github.io/

Fernando Raviola feresr

🐨
https://feresr.github.io/
View GitHub Profile
@feresr
feresr / .vimrc
Last active Jun 8, 2022
My vim config
View .vimrc
"TODO: install Ag: brew install the_silver_searcher
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2008 Jul 02
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
View rxcoroutines.kt
package com.glovoapp.notification.in_app_notification
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
View ImageView.kt
fun ImageView.loadFromCloudinary(
resource: String,
onSuccess: () -> Unit = {},
onError: () -> Unit = {},
configure: (RequestBuilder<Drawable>) -> Unit = {},
mediaManager : MediaManager = MediaManager.get()
) = doOnLayout {
val transformation: EagerTransformation? = EagerTransformation().fetchFormat("webp")
val cloudinaryUrl = mediaManager.url().transformation(transformation)
mediaManager.responsiveUrl(ResponsiveUrl.Preset.AUTO_FILL)
View EditorVM.kt
class EditorViewModel : ViewModel() {
private var appliedFilters = MutableStateFlow(sortedMapOf<FILTER, FloatArray>())
val lightContextualViewModel = SliderContextualViewModel(
onFilterChanged = ::onValueChanged,
filterFlow = appliedFilters.map {
it.filterKeys { listOf(FILTER.EXPOSURE, FILTER.GRAIN, FILTER.VIBRANCE).contains(it) }
},
onFilterCommitted = history::onCommit
View SliderContextualViewModel.kt
open class SliderContextualViewModel(
val filterFlow: StateFlow<Map<FILTER, FloatArray>>,
val onFilterChanged: (FILTER, FloatArray) -> Unit,
val onFilterCommitted: () -> Unit = {}
)
@Composable
fun SliderContextual(modifier: Modifier, viewModel: SliderContextualViewModel) {
val sliding = remember { mutableStateOf(false) }
Card(
View presets.json
{
"home": {
"packOfTheDay": 212,
"featured": [
1,
4,
5,
9,
11,
13,
@feresr
feresr / MainActivity.kt
Created Jun 1, 2021
Android update underlying bitmap
View MainActivity.kt
package com.feresr.composebitmap
import android.graphics.Bitmap
import android.graphics.Color
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.Button
View gist:0529faa95aa28a7e1c877490f695c72c
Once I’ve updated the dependencies I set off to test it:
= I set my user Feature flags to be on
= Connected to the VPN and reset the user idverification  data from the database using this guide
= Try to login, wasn’t able to because of some backend problem affecting other devs as well
= Took a few hours to fix the problem, but only for my specific user, not sure if the more general problem is fixed (I think backend is investigating)
= But now I’m also getting an error while refreshing profile, it’s showing a message to the user “Unknown error” (started debugging, after a while I found out this courier has no cc and that might be the reason)
= Added a credit card using glovotest.com , but the issue wasn’t resolved
= Logged out to try logging in again and now I’m getting an empty toast in the screen, can’t log back in (empty message showing up, recorded a video and let the team know about it)
View JumioAuthCrash.xml
//manifest.xml
...
<activity
android:name="com.jumio.nv.NetverifyActivity"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|uiMode|layoutDirection"
android:hardwareAccelerated="true"
android:theme="@style/CustomNetverifyTheme"
android:windowSoftInputMode="adjustResize" />
...
View DP.kt
package com.feresr.threedp
import android.os.Bundle
import android.view.MotionEvent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.size
import androidx.compose.material.Surface
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier