Skip to content

Instantly share code, notes, and snippets.

Arik Achmad kiratheone

Block or report user

Report or block kiratheone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kiratheone
kiratheone / gist:37629bf8671cccb4dc42d515e225056c
Created Mar 17, 2019 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1
View gist:37629bf8671cccb4dc42d515e225056c

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@kiratheone
kiratheone / LiveData.ext.kt
Created Oct 29, 2018 — forked from tinmegali/LiveData.ext.kt
Kotlin extension to allow Unit tests on Android LiveData
View LiveData.ext.kt
package com.tinmegali.daggerwithkotlin.room
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
// Extension to allow unit tests on LiveData
// discussion on: https://stackoverflow.com/questions/44270688/unit-testing-room-and-livedata
@kiratheone
kiratheone / 00_etc-hosts.md
Created Oct 22, 2018 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Netflix, Reddit, and Imgur.
View 00_etc-hosts.md

Unblock Vimeo, Netflix, Reddit, dan Imgur

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

Tambahkan list di bawah ke %System32%\Drivers\etc\hosts

@kiratheone
kiratheone / ApiResponse.java
Created Sep 5, 2018 — forked from AkshayChordiya/ApiResponse.java
LiveData adapter for Retrofit
View ApiResponse.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@kiratheone
kiratheone / RealPathUtil.kt
Created Aug 16, 2018 — forked from micer/RealPathUtil.kt
Utility class to get real path from URI object - all API versions
View RealPathUtil.kt
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.DocumentsContract
import android.provider.MediaStore
import android.support.v4.content.CursorLoader
import android.text.TextUtils
You can’t perform that action at this time.