This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static OkHttpClient getUnsafeOkHttpClient() { | |
try { | |
// Create a trust manager that does not validate certificate chains | |
final TrustManager[] trustAllCerts = new TrustManager[] { | |
new X509TrustManager() { | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##---------------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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
OlderNewer