Skip to content

Instantly share code, notes, and snippets.

View kyawhtut-cu's full-sized avatar
🎯
Focusing

Kyaw Htut kyawhtut-cu

🎯
Focusing
View GitHub Profile
@gunhansancar
gunhansancar / fibonacci.kt
Last active March 12, 2022 09:04
Recursive vs Iterative with #Kotlin and #Fibonacci sequence
import java.time.Duration
import java.time.Instant
object Fibonacci {
fun recursive(n: Long): Long = if (n < 2) n else recursive(n - 1) + recursive(n - 2)
tailrec fun recursiveTail(n: Long, a: Long, b: Long): Long
= if (n < 1) a else recursiveTail(n - 1, b, a + b)
fun iterative(n: Long): Long {
@NezSpencer
NezSpencer / MainActivity.kt
Created October 1, 2018 09:36
Responsive naira amount textWatcher
package com.nezspencer.test
import android.os.Bundle
import android.support.annotation.NonNull
import android.support.v7.app.AppCompatActivity
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.widget.EditText
import java.text.NumberFormat
@d4vidi
d4vidi / RVPagerSnapFancyDecorator.kt
Last active July 27, 2022 11:17
A RecyclerView decorator that lets your easily turn a PagerSnapHelper from a provider of a simple full-screen "ViewPager" onto the common fancy cards carousel (such as duo lingo's: http://i.imgur.com/UXpVigQ.gif).
package com.d4vidi
import android.content.Context
import android.graphics.Rect
import android.support.annotation.Px
import android.support.v7.widget.RecyclerView
import android.view.View
/**
* A [RecyclerView decorator][RecyclerView.ItemDecoration] which, if applied over a recycler view
@unnikked
unnikked / README.md
Last active February 19, 2024 02:58
How to host your Telegram bot on Google App Script

Telegram Bot on Google App Script

This is the source code of one of my blog post. To read the full blog post please click here.

@jemshit
jemshit / proguard-rules.pro
Last active November 10, 2024 16:50
Proguard Rules for Android libraries
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;