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 / adb-pull-sqlite.sh
Last active September 30, 2017 09:12
adb-pull-sqlite.sh
#!/bin/bash
# Copyright (c) 2014 Leonard Wu <leonard.wu92@alumni.ic.ac.uk>
# 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 <andhikayuana@gmail.com>
* @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 / 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.

@andhikayuana
andhikayuana / tmux-cheatsheet.markdown
Created April 16, 2018 14:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andhikayuana
andhikayuana / android_studio_shortcuts.md
Created April 22, 2018 02:16 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@andhikayuana
andhikayuana / README.md
Created April 27, 2018 04:31 — forked from lopspower/README.md
Configuration of proguard-rules.pro

Proguard Configuration

Twitter

1) Enable Proguard in your build.gradle module :

android {
    //...
 buildTypes {