Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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

Esa Firman esafirm

🏠
Working from home
View GitHub Profile
Testing started at 9:26 AM ...
07/18 09:26:57: Launching LoginActivityEspress...
$ adb push /Users/esa/Documents/AndroidStudioProjects/driver-android-new/apks/etobeedriver-dev-debug.apk /data/local/tmp/com.etobee.driver
$ adb shell pm install -r "/data/local/tmp/com.etobee.driver"
pkg: /data/local/tmp/com.etobee.driver
Success
$ adb push /Users/esa/Documents/AndroidStudioProjects/driver-android-new/etobeedriver/build/outputs/apk/etobeedriver-dev-debug-androidTest.apk /data/local/tmp/com.etobee.driver.test
Pasang ini untuk membuka akses blokir selain tiga dibawah ini. Pilih resolver yang paling deket (singapura)
https://dnscrypt.org
@esafirm
esafirm / build.gradle
Created November 3, 2016 14:25 — forked from ph0b/build.gradle
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@esafirm
esafirm / podfile.rb
Created October 26, 2016 03:29
Podfile for Rame to achieve Swift 3 compatibility
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'Rame' do
pod 'Alamofire', :git => 'https://github.com/Homely/Alamofire.git', :branch => 'ios8'
pod "SWSegmentedControl"
pod 'Google/SignIn'
pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :tag => 'v3.0.0'
@esafirm
esafirm / README
Created September 24, 2016 13:23 — forked from MarsVard/README
android drawable to imitate google cards.
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"
@esafirm
esafirm / NoteRepository.java
Last active September 8, 2016 05:40
Realm object repository sample
// The code using Java 8 Lambda
public class NoteRepository {
public static Note createNote() {
Note note = new Note();
note.setId(new RandomString(6).nextString());
return note;
}
public static void updateTitle(String noteId, String title) {
@esafirm
esafirm / setup.sh
Last active March 31, 2017 06:01
Terminal Setup
## In case it's still apt-get
echo 'alias apt="apt-get"' >> ~./bashrc
## Update APT
apt update
## Essentials
apt -y install htop xclip tmux unzip zsh git
## Change Shell Default to ZSH
@esafirm
esafirm / ObengAPI.java
Last active February 9, 2016 15:26
What's better than documentation? A sample code ..
package com.satulingkaran.obeng.http;
import com.satulingkaran.obeng.data.model.Area;
import com.satulingkaran.obeng.data.model.BaseResponse;
import com.satulingkaran.obeng.data.model.Bengkel;
import com.satulingkaran.obeng.data.model.Category;
import com.satulingkaran.obeng.data.model.EditResponse;
import com.satulingkaran.obeng.data.model.JenisUsaha;
import com.satulingkaran.obeng.data.model.User;
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
@esafirm
esafirm / EndlessRecyclerOnScrollListener.java
Created October 18, 2015 01:26 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;