Skip to content

Instantly share code, notes, and snippets.

Working from home

Esa Firman esafirm

Working from home
View GitHub Profile
esafirm / 0_reuse_code.js
Created Jul 18, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Android Sub Menu
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="">
<item android:id="@+id/file"
android:title="@string/file" >
<!-- "file" submenu -->
<item android:id="@+id/create_new"
android:title="@string/create_new" />
<item android:id="@+id/open"
android:title="@string/open" />
esafirm /
Last active May 7, 2018 — forked from chalup/
Get OkHttpClient which ignores all SSL errors.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public void checkClientTrusted([] chain, String authType) throws CertificateException {
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;
View Gson Proguard
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
esafirm /
Last active Feb 9, 2016
What's better than documentation? A sample code ..
package com.satulingkaran.obeng.http;
esafirm /
Last active Mar 31, 2017
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 /
Last active Sep 8, 2016
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 / README
Created Sep 24, 2016 — 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
esafirm / podfile.rb
Created Oct 26, 2016
Podfile for Rame to achieve Swift 3 compatibility
View podfile.rb
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
target 'Rame' do
pod 'Alamofire', :git => '', :branch => 'ios8'
pod "SWSegmentedControl"
pod 'Google/SignIn'
pod 'Charts', :git => '', :tag => 'v3.0.0'
You can’t perform that action at this time.