Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View feresr's full-sized avatar

Fernando Raviola feresr

View GitHub Profile
Introduction
This Terms of Service agreement ("Agreement") is entered into by and between Stax Technologies ("Company," "we," or "us") and the individual or entity ("User," "you," or "your") accessing or using the Stax service.
Acceptance of Terms
By accessing or using the Stax service, you agree to be bound by the terms and conditions of this Agreement. If you do not agree, you may not use the service.
User Accounts
Users must create an account to use Stax. Account holders are responsible for maintaining the confidentiality of their account information.
App Usage
@feresr
feresr / .vimrc
Last active June 8, 2022 20:21
My vim config
"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
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
@feresr
feresr / ImageView.kt
Created July 21, 2021 14:23
ImageView
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)
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
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(
@feresr
feresr / presets.json
Created June 25, 2021 15:27
presets.json
{
"home": {
"packOfTheDay": 212,
"featured": [
1,
4,
5,
9,
11,
13,
@feresr
feresr / MainActivity.kt
Created June 1, 2021 18:10
Android update underlying bitmap
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
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)
//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" />
...