Skip to content

Instantly share code, notes, and snippets.

View radityagumay's full-sized avatar
🏠
Working from home

raditya gumay radityagumay

🏠
Working from home
View GitHub Profile
@radityagumay
radityagumay / privacy_policy.md
Created March 14, 2026 04:47
My Quran Privacy Policy

Privacy Policy

My Quran Last updated: March 14, 2026

Introduction

This Privacy Policy describes how My Quran ("we", "our", or "the app") handles information when you use our mobile application. My Quran is an open-source Islamic application that provides Quran reading, prayer times, memorization tools, and other Islamic resources.

We are committed to protecting your privacy. The app is designed to function with minimal data collection and does not require any user account or login.

@radityagumay
radityagumay / app_size_benchmark.sh
Last active July 9, 2025 02:41
android app bundle size benchmark script
#!/usr/bin/env bash
set -euo pipefail
function usage() {
echo "Usage: $0 --base=<baseline.aab> --head=<head.aab>"
exit 1
}
# ─── Parse args ─────────────────────────────────────────────────────────────────
BASE="" HEAD=""
@radityagumay
radityagumay / proguard-aftertask.gradle
Created July 20, 2021 23:19
Delete certain proguard rule
```groovy
afterEvaluate {
// All proguard tasks shall depend on our filter task
def proguardTasks = tasks.findAll { task ->
task.name.startsWith('transformClassesAndResourcesWithProguardFor') }
proguardTasks.each { task -> task.dependsOn filterConsumerRules }
}
// Let define our custom task that filters some unwanted
// consumer proguard rules
@radityagumay
radityagumay / DataStoreFactory.kt
Last active March 30, 2021 00:05
Singleton Class to Manage DataStore
internal object DataStoreFactory {
private val mapToDataStore = ConcurrentHashMap<String, DataStore<Preferences>>()
fun create(
name: String,
context: Context
): DataStore<Preferences> {
if (mapToDataStore.containsKey(name).not()) {
mapToDataStore[name] = context.getDataStore(
/**
* Implementation Detail
*/
interface FooPresenterContract {
interface Presenter {
fun doWork()
}
interface View {
fun inflated(message: String)
class FooPresenterTest {
private val view = mock<FooPresenterContract.View>()
private val presenter: FooPresenterContract.Presenter = FooPresenter(view)
@Test
fun testDoWork() {
presenter.doWork()
verify(view).inflated("it was success!")
@radityagumay
radityagumay / NetworkBuilder.swift
Created September 10, 2020 15:57
Network Builder in Swift based on Android Retrofit Builder Pattern
protocol Dao {
func insert(key: String, value: Any) -> Bool
func find(key: String) -> Any?
}
protocol StoreAdapterFactory {
func create() -> Dao
}
class StoreMemoryAdapter : Dao {
@radityagumay
radityagumay / ContactBuilder.swift
Last active September 10, 2020 14:24
A builder pattern in swift which follow Head First Design Pattern
class Contact {
private(set) lazy var name: String
private(set) lazy var phoneNumber: String
private(set) lazy var address: String
private(set) lazy var gender: String
private init(
name: String,
phoneNumber: String,
address: String,
fun main() {
val les = Executors.newFixedThreadPool(5)
for (i in 0..9) {
val worker: Runnable = WorkerThread("" + i)
les.execute(worker)
}
les.shutdown()
while (!les.isTerminated) { }
println("Finished all threads")
}
{
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "I came from a real tough neighborhood. Once a guy pulled a knife on me. I knew he wasn't a professional, the knife had butter on it.",
"length": "132",
"author": "Rodney Dangerfield",