Skip to content

Instantly share code, notes, and snippets.

View pratamawijaya's full-sized avatar

Pratama Nur Wijaya pratamawijaya

View GitHub Profile
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
import com.google.gson.FieldNamingPolicy
import com.google.gson.GsonBuilder
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit
object Network {
@pratamawijaya
pratamawijaya / build.gradle.kts
Created September 5, 2023 06:08 — forked from shahzadansari/build.gradle.kts
Custom gradle task which copies app-debug.apk to Desktop and renames it to Git's current checked out branch
// 1. Add following snippet in your build.gradle.kts(:app)
// Run this command in terminal -> ./gradlew copyDebugApkToDesktop
tasks.register("copyDebugApkToDesktop") {
dependsOn("assembleDebug")
doLast {
val sourceDir = "build/outputs/apk/debug/app-debug.apk"
val desktopDir = System.getProperty("user.home") + "/Desktop/"
val gitBranch = try {
@pratamawijaya
pratamawijaya / README.md
Created November 9, 2022 03:07 — forked from jhonsore/README.md
Upload an Image from camera or gallery in WebView

This is an old way to Upload an Image from camera or gallery in WebView. It was made a long time ago and is not maintened anymore. Use it at your own risk.

@Composable
fun CalendarView(
modifier: Modifier = Modifier,
selectedDay: CalendarDay = CalendarDay.create(),
onSelectedDayChange: (CalendarDay) -> Unit = {},
visibleMonth: CalendarDay = CalendarDay.create(),
onVisibleMonthChange: (CalendarDay) -> Unit = {},
today: CalendarDay = CalendarDay.create(),
events: Set<CalendarDay> = emptySet()
) {
@pratamawijaya
pratamawijaya / PreferenceExtensions.kt
Created November 14, 2019 10:37 — forked from ologe/PreferenceExtensions.kt
Android shared preference observer using kotlin coroutines (1.3.0)
inline fun <reified T> SharedPreferences.observeKey(key: String, default: T, dispatcher: CoroutineContext = Dispatchers.Default): Flow<T> {
val flow: Flow<T> = channelFlow {
offer(getItem(key, default))
val listener = SharedPreferences.OnSharedPreferenceChangeListener { _, k ->
if (key == k) {
offer(getItem(key, default)!!)
}
}
@pratamawijaya
pratamawijaya / keybase.md
Created September 13, 2019 09:27
keybase

Keybase proof

I hereby claim:

  • I am pratamawijaya on github.
  • I am pratamawijaya (https://keybase.io/pratamawijaya) on keybase.
  • I have a public key ASDJemJ8yN5oby1WxRtRlnlz_ECsotrC8DDhKn0L9yvBoQo

To claim this, I am signing this object:

@pratamawijaya
pratamawijaya / simi_key.json
Last active March 17, 2019 03:21
simi_key.json
{
"url" : "http://api.simsimi.com/request.p",
"key" : "74c1bbd9-0693-41f2-b72b-29c9c59467ac"
}
@pratamawijaya
pratamawijaya / medium_rider_redesign_blog_example.kt
Created October 21, 2018 12:32 — forked from abhaysood/medium_rider_redesign_blog_example.kt
A simple component which is created when user clicks the cancel order button in the app. It is responsible for showing a confirmation dialog and actually cancelling the order by making an API call.
class OrderCancellationComponent(private val context: Context,
private val api: Api,
private val orderNumber: String) {
interface Callbacks {
fun onOrderCancelledSuccessfully()
fun onOrderCancellationFailed()
}
var callbacks: Callbacks? = null // Callbacks for communication with the parent component
@pratamawijaya
pratamawijaya / news.json
Last active September 15, 2018 05:18
news api
{
"status": "ok",
"totalResults": 5026,
"articles": [
{
"source": {
"id": null,
"name": "Bitcoinist.com"
},
"author": "Eric Yao",