Skip to content

Instantly share code, notes, and snippets.

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

Zainal Fahrudin zainalfh

🏠
Working from home
View GitHub Profile
@zainalfh
zainalfh / Utils.kt
Created February 13, 2025 04:27
extension for simple add text change listener and remove it. Generated with GeminiAI
package app.keyboardly.addon.chatgpt
import android.text.Editable
import android.text.TextWatcher
import android.widget.TextView
import androidx.coordinatorlayout.widget.CoordinatorLayout
/**
* Created by Zainal on 13/02/2025 - 08:57
*/
@zainalfh
zainalfh / PagingHelper.kt
Created November 18, 2024 15:13
its simple generator pagination. will generate something like this : 1,2,3,4,...,1239
import kotlin.math.min
/**
* Created by Zainal on 14/11/2024 - 09:15
*/
object PaginationHelper{
private const val pageSize = 10
private fun getTotalPages(totalItems :Int): Int {
[
{
"id": "11",
"name": "ACEH",
"alt_name": "ACEH",
"latitude": 4.36855,
"longitude": 97.0253
},
{
"id": "12",
@zainalfh
zainalfh / BaseFragment.kt
Last active September 23, 2021 12:29
Dummy Data Generator Kotlin
abstract class BaseFragment : Fragment(){
fun generateDummy(): List<Contact> {
val list = mutableListOf<Contact>()
for (i in 0 until 10){
list.add(
Contact(
getRandomString()+" "+getRandomString(),
getRandomString(),
"+62"+getRandomNumber(),
@zainalfh
zainalfh / README.md
Created March 19, 2021 04:02 — forked from richardblondet/README.md
Create a restful API with Google App Script CRUD and a Spreadsheet

Google App Script CRUD

Inspired by this gist.

Getting Started

  1. Create a new App Script project.
  2. Paste the content of the file google-app-script-crud.gs in the default Code.gs file.
  3. Create a new Spreadsheet.
  4. Copy the Spreadsheet ID found in the URL into the variable SHEET_ID located in line 1 of your file.
@zainalfh
zainalfh / Privacy Policy.md
Last active May 5, 2019 00:53
Currency Converter app

Privacy Policy

Khoiru Code built the Currency Converter app as an Ad Supported app. This SERVICE is provided by Khoiru Code at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Currency Converter unless otherwise defined in this Privacy Policy.

@zainalfh
zainalfh / gist:6a58ca5c4d53cedeb75a697911370d17
Created October 27, 2017 03:17 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@zainalfh
zainalfh / DateFormatAndroid.md
Last active September 29, 2017 02:26
formating date time on android
DateFormat df = new SimpleDateFormat("EEE, d MMM yyyy, HH:mm");
String date = df.format(Calendar.getInstance().getTime());

Format ---- output

"yyyy.MM.dd G 'at' HH:mm:ss z" ---- 2001.07.04 AD at 12:08:56 PDT
"hh 'o''clock' a, zzzz" ----------- 12 o'clock PM, Pacific Daylight Time
@zainalfh
zainalfh / 51-android.rules
Created September 26, 2017 14:07 — forked from jdamcd/51-android.rules
Full set of Android USB vendor ID rules for Linux
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev" #Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev" #ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev" #Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev" #Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev" #Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" #Google
SUBSYSTEM=="usb", ATTR{idVendor}=="201E", MODE="0666", GROUP="plugdev" #Haier
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0666", GROUP="plugdev" #Hisense
@zainalfh
zainalfh / RxJavaExamples.java
Created August 21, 2017 14:32 — forked from ariesmcrae/RxJavaExamples.java
RxJava examples using Java 8 Lambda. Examples include zip, map, take, filter, reduce
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import rx.Observable;
import rx.Observer;
import rx.functions.Func2;
public class RxJavaExamples {