Skip to content

Instantly share code, notes, and snippets.

View andhikayuana's full-sized avatar
🌏
bertapa

Andhika Yuana andhikayuana

🌏
bertapa
View GitHub Profile
@andhikayuana
andhikayuana / SubscribtionController.java
Last active September 7, 2017 05:18
AsyncTask POST form
package com.yyz;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
@andhikayuana
andhikayuana / EditTextOtp.java
Last active October 13, 2023 07:23
OTP View 4 Digit Value
import android.content.Context;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
@andhikayuana
andhikayuana / SharedPrefUtil.java
Created September 7, 2017 05:17
Shared Preferences Android Utility
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
/**
* @author yuana <[email protected]>
* @since 12/27/16
*/
public class SharedPrefUtil {
@andhikayuana
andhikayuana / adb-pull-sqlite.sh
Last active September 30, 2017 09:12
adb-pull-sqlite.sh
#!/bin/bash
# Copyright (c) 2014 Leonard Wu <[email protected]>
# MIT License
# Android SQLite DB Pull (adb-db-pull, v1.2)
# https://github.com/leonardw/adb-db-pull.git
ADB=`which adb`
ADB_SHELL="$ADB shell"
SELF=`basename $0`
@andhikayuana
andhikayuana / ItemWidgetSettingView.java
Last active October 8, 2017 00:35
ItemWidgetSettingView.java
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@andhikayuana
andhikayuana / TabView.java
Last active October 8, 2017 00:49
TabView.java
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.annotation.StringRes;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
@andhikayuana
andhikayuana / NetworkUtil.java
Created December 11, 2017 10:22
Network Detector
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* @author yuana <[email protected]>
* @since 12/11/17
*/
@andhikayuana
andhikayuana / readme.md
Created February 2, 2018 06:45
Some Util

paginate List

    public static <T> List<List<T>> getPaginate(Collection<T> c, Integer pageSize) {
        if (c == null) return Collections.emptyList();
        List<T> list = new ArrayList<T>(c);
        if (pageSize == null || pageSize <= 0 || pageSize > list.size()) pageSize = list.size();
        int numPages = (int) Math.ceil((double) list.size() / (double) pageSize);
        List<List<T>> pages = new ArrayList<List<T>>(numPages);
        for (int pageNum = 0; pageNum < numPages; ) {
@andhikayuana
andhikayuana / gradle.properties
Last active September 22, 2023 04:31
publishing aar
libraryGroupId=yuana.id
libraryArtifactId=anu
libraryVersion=1.0.0
@andhikayuana
andhikayuana / intro.md
Created April 13, 2018 04:07 — forked from derhuerst/intro.md
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows

Installing zsh – the easy way

The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Z shell – Wikipedia

Read more about ZSH at An Introduction to the Z Shell.

Choose one of the following options.