Skip to content

Instantly share code, notes, and snippets.

View Dwite's full-sized avatar
👨‍🎨
Idea-rich, sleep-poor: that's the dad-indie hacker's life!

Valerii Kuznietsov Dwite

👨‍🎨
Idea-rich, sleep-poor: that's the dad-indie hacker's life!
View GitHub Profile
@pablisco
pablisco / gist:da25563d57559dd1d18f165272269b57
Last active April 15, 2022 03:23
ResourcesExceptions.kt
import android.content.Context
import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.support.annotation.AnyRes
import android.support.v4.app.Fragment
import android.support.v4.content.res.ResourcesCompat.*
import android.view.View
val Context.animations
get() = ResourceMapper { resources.getAnimation(it) }
@elihart
elihart / EpoxyGlidePreloader.kt
Last active October 18, 2021 14:47
Utility to set up a RecyclerView scroll listener that enables preloading support with Glide in Epoxy library usages.
package com.airbnb.epoxy
import android.content.Context
import android.graphics.Bitmap
import android.support.annotation.IdRes
import android.support.annotation.Px
import android.support.v7.widget.RecyclerView
import android.view.View
import com.bumptech.glide.Glide
import com.bumptech.glide.RequestBuilder
@igogrek
igogrek / Cookbook.md
Last active May 29, 2024 02:00
Cookbook

This cookbook is similar to Vue cookbook but contains our custom recipes for some specific cases.

Form validation

For form validation we use Vuelidate

export default Vue.extend({
  ...
 validations: {
@ArthurNagy
ArthurNagy / RoundedBottomSheetDialogFragment.kt
Last active March 10, 2025 08:53
Rounded modal bottom sheet as seen in new Google products(Tasks, News, etc.), described in this article: https://medium.com/halcyon-mobile/implementing-googles-refreshed-modal-bottom-sheet-4e76cb5de65b
package com.your.package
import android.app.Dialog
import android.os.Bundle
import com.your.package.R
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
/**
* BottomSheetDialog fragment that uses a custom
class PostRepositoryImplTest {
private lateinit var repository: PostRepositoryImpl
private val mockCacheDataSource: PostCacheDataSource = mock()
private val mockRemoteDataSource: PostRemoteDataSource = mock()
private val postId = post.id
private val cacheItem = post.copy(title = "cache")
@vklachkov
vklachkov / android_text_input_layout.xml
Last active April 1, 2021 09:18
Colorize TextInputLayout.FilledBox
<!-- See: -->
<!-- https://medium.com/omisoft/textinputlayout-styling-8b36a5e0d73c -->
<!-- Style and color must be placed into different files -->
<!-- Style -->
<style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
<item name="hintTextColor">@color/input_box_color</item>
<item name="passwordToggleTint">@color/input_box_color</item>
<item name="boxStrokeColor">@color/input_box_color</item>