Skip to content

Instantly share code, notes, and snippets.

View irfanirawansukirman's full-sized avatar
💻
Still on bake

Irfan Irawan Sukirman, S,Kom irfanirawansukirman

💻
Still on bake
View GitHub Profile
@mochadwi
mochadwi / README.md
Last active September 3, 2021 10:26
How to check for transitive dependencies
$: ./gradlew :<your base module>:dependencies > dependencies.txt
$: # vim or nano `dependencies.txt`
$: vim dependencies.txt
$: # try to search the dependencies version used, to detect which transitive dependency making our build fails

If there's a problem with a specific version of your dependencies, try to search the version was pulled from which dependencies, e.g:

our current project dependencies has different version of androidx.test:monitor, see images

@patrickfav
patrickfav / AesGcmTest.java
Last active February 27, 2024 11:32
Java Authenticated Encryption with AES and GCM.
package at.favre.lib.bytes.otherPackage;
import org.junit.Test;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
@nwellis
nwellis / SquareCutoutOverlay.kt
Created January 24, 2019 15:33
View to add a semitransparent overlay with a fully transparent square cutout
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
import kotlin.math.max
import kotlin.math.min
class SquareCutoutOverlay(
context: Context,
@wispborne
wispborne / Preferences.kt
Last active July 21, 2022 03:47
Android SharedPreferences helper class for Kotlin. Easy-to-use delegated properties, automatic database creation, and listening for property changes.
import android.content.Context
import android.content.SharedPreferences
import kotlin.reflect.KProperty
/**
* Represents a single [SharedPreferences] file.
*
* Usage:
*
* ```kotlin
@demixdn
demixdn / EditTextDebounce.java
Created April 24, 2017 09:58
Get text from EditText with debounce without RxJava
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import java.lang.ref.WeakReference;
// Random terminal tip #1
//You'll see this message if you git commit without a message (-m)
// You can get out of it with two steps:
// 1.a. Type a multi-line message to move foward with the commit.
// 1.b. Leave blank to abort the commit.
// 2. Hit "esc" then type ":wq" and hit enter to save your choice. Viola!
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
@orhanobut
orhanobut / gist:8665372
Created January 28, 2014 10:34
Up down animation for dialog fragment
// Slide up animation
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="100%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0" />