Skip to content

Instantly share code, notes, and snippets.

View isfaaghyth's full-sized avatar
Work from home

Muh Isfhani Ghiath isfaaghyth

Work from home
View GitHub Profile
{
"status": 200,
"chapters": [
{
"name": "GDG Jakarta",
"link": "https://gdg.community.dev/gdg-jakarta/",
"banner": "https://www.sinarmasland.com/app/uploads/2023/07/Foto-2-Google-IO-Extended-2023-di-Digital-Hub-BSD-City-scaled.jpg",
"organizers": [
{
"name": "P Adhi Nugroho",
val Long.bits: BitValue get() = BitValue(this)
inline val Long.bit: BitValue get() = bits
inline val Int.bits: BitValue get() = toLong().bits
inline val Int.bit: BitValue get() = bits
inline val Long.bytes: BitValue get() = times(8).bits
inline val Long.byte: BitValue get() = bytes
inline val Long.B: BitValue get() = bytes
import android.content.Context
import android.graphics.Canvas
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatEditText
class CustomEditTextView: AppCompatEditText {
private var padding = -1f
private var prefix = ""
@isfaaghyth
isfaaghyth / bootable-win-on-mac.md
Last active February 16, 2021 15:52
How to create Windows bootable on MacOS

Requirement

Format flashdisk into MBR

  1. check your flashdisk directory using diskutil list, for example, my flashdisk is dev/disk3.
  2. format it with diskutil eraseDisk MS-DOS WIN_LABEL MBR /dev/disk3

Create a bootable

  1. Install the wimlib via homebrew brew install wimlib
@isfaaghyth
isfaaghyth / isfa.md
Last active July 20, 2020 19:46
👾 Android Space

anything about android stuff!

get current activity

adb shell dumpsys window windows | grep -E 'mCurrentFocus'

start activity

adb shell am start -a android.intent.action.MAIN -n com.isfaaghyth.sample/.MainActivity

start activity with applink

adb shell am start -a android.intent.action.VIEW -d 'isfaaghyth://home'

internal class CacheManager(context: Context?) {
val preferences: SharedPreferences? by lazy(LazyThreadSafetyMode.NONE) {
sharedPreferences(context)
}
inline fun <reified T> entry(key: String, obj: T) {
val objString = Gson().toJson(obj, T::class.java)
preferences?.edit()?.putString(key, objString)
}
package app.tokopedia.movie.ui
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import app.tokopedia.movie.R
import kotlinx.android.synthetic.main.item_movie.view.*
import tokopedia.app.abstraction.util.ext.load
import tokopedia.app.data.entity.Movie

Raw Query Factory:

interface GraphQuery {
    @RawQuery(R.raw.product_search)
    fun productSearch(): Extractor<String>
}

Thread:

package com.apps.search.utils
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager
abstract class EndlessRecyclerViewScrollListener : RecyclerView.OnScrollListener {
// The minimum amount of items to have below your current scroll position
// before loading more.
fun ffmegCommand(cropSize: Int?, sourceFile: String, resultFile: String): Array<String> {
return arrayOf(
"-i",
sourceFile,
"-filter:v",
"crop=$cropSize:$cropSize",
"-codec:v",
"libx264",
"-profile:v",
"high",