Skip to content

Instantly share code, notes, and snippets.

View pratamawijaya's full-sized avatar

Pratama Nur Wijaya pratamawijaya

View GitHub Profile
h scroll left
j scroll down
k scroll up
l scroll right
gg scroll to top of the page
G scroll to bottom of the page
f activate link hints mode to open in current tab
F activate link hints mode to open in new tab
r reload
@pratamawijaya
pratamawijaya / git_submodules.md
Created October 16, 2017 09:05 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@pratamawijaya
pratamawijaya / iterm2-solarized.md
Created September 7, 2017 08:58 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@pratamawijaya
pratamawijaya / EndlessListActivity.java
Created July 25, 2017 04:24 — forked from polbins/EndlessListActivity.java
Android Endless Scroll using RecyclerView
public class EndlessListActivity<D> extends Activity {
private EndlessRecyclerOnScrollListener mEndlessScrollListener;
private EndlessListAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RecyclerView listView = (RecyclerView) findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
@pratamawijaya
pratamawijaya / ResultHolder.java
Created June 15, 2017 05:00 — forked from 1zaman/ResultHolder.java
Loader for Retrofit 2.0 API. This uses the framework implementation, but it can be adapted to use the support library implementation without much modification.
package com.example.retrofit.loader;
import retrofit.Response;
/**
* A wrapper around the Retrofit {@link Response} that will
* throw any loading errors upon retrieval.
*
* @param <T> The data type that was loaded.
*/
@pratamawijaya
pratamawijaya / APP
Created April 17, 2017 04:39 — forked from pishguy/APP
Implementing JobManager on Dagger2
public class Alachiq extends MultiDexApplication {
...
private static Context context;
public static SlidrConfig config;
private GithubService githubService;
private Picasso picasso;
private static GithubApplicationComponent component;
private JobManager jobManager;
private static Alachiq instance;
@pratamawijaya
pratamawijaya / MySQL.md
Created March 15, 2017 04:55 — forked from nrollr/MySQL.md
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

@pratamawijaya
pratamawijaya / intellij_username
Created February 26, 2017 07:21 — forked from dedickinson/intellij_username
Override the username in IntelliJ templates
(For OS X)
See: https://www.jetbrains.com/idea/help/tuning-intellij-idea.html
> mkdir ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/
> cp /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.vmoptions ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/
> vi ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/idea.vmoptions
Add the line below:
-Duser.name=Duncan Dickinson
@pratamawijaya
pratamawijaya / tmux-cheatsheet.markdown
Created January 13, 2017 06:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pratamawijaya
pratamawijaya / ApiModule.java
Created December 17, 2016 10:28 — forked from koesie10/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()