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 / layout.xml
Created August 21, 2017 06:25
AppBar Scrolling with Flexible Space and content overlapping
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
@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)
}
@isfaaghyth
isfaaghyth / test.php
Last active February 3, 2020 17:09
Split Name, Birth, and Born with PHP
<?php
/*
apply for : Isfahani Ghiyath 24 Makassar or,
Isfahani Ghiyath 24 Th Makassar or,
Isfahani Ghiyath 24 Tahun Makassar or,
Isfahani Ghiyath 24 Tahun Sulawesi Selatan.
*/
$test = "Isfahani Ghiyath 24 Tahun Makassar";
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
@isfaaghyth
isfaaghyth / mysql.sql
Created December 20, 2018 20:18
InnoDB: Unable to lock ./ibdata1, error: 11
# cd /var/lib/mysql
# mkdir bak
# mv ibdata1 bak/.
# mv ib_logfile* bak/.
# cp -a bak/ibdata1 ibdata1
# cp -a bak/ib_logfile* .
# service mysql restart