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
public class MainActivity extends AppCompatActivity | |
implements GoogleApiClient.ConnectionCallbacks, | |
GoogleApiClient.OnConnectionFailedListener { | |
private static final String TAG = MainActivity.class.getSimpleName(); | |
private SupportMapFragment mapFragment; | |
private MapObservableProvider mapObservableProvider; | |
private CompositeSubscription subscriptions = Subscriptions.from(); | |
private GoogleMap googleMap; |
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.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Environment; | |
import android.provider.MediaStore; | |
import android.support.v4.app.Fragment; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.IOException; |
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
<?php | |
$to = | |
"USER_PUSH_TOKEN_HERE"; | |
$fields = array( | |
'to' => $to, | |
// custom payload for a client to handle | |
// use `notification` array for more general predefined key/value payload instead | |
'data' => array( | |
"title" => "test notification title " . rand(1, 1000), | |
"body" => "Christopher Edward Hansen (born September 13, 1959)[2] is an American television journalist. He is known for his work on Dateline NBC, in particular the former segment To Catch a Predator, which revolved around catching potential Internet sex predators using a sting operation. His also hosts Killer Instinct on Investigation Discovery, which documents homicide investigations.[3] He is also the new host of the syndicated show Crime Watch Daily. [4]<br/><br/><img src=\"http://www.kualalumpurpost.net/wp-content/uploads/2013/10/tpeli.jpg\">", |
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
// ==UserScript== | |
// @name Hide Yo' Feed | |
// @namespace https://gist.github.com/aimanbaharum/b8262ebcafdcdedd4461fdb4105c6b10 | |
// @include https://*.facebook.com/ | |
// @version 0.2 | |
// @description Hide Facebook news feed like you never care seeing them! Facebook is still usable, news feed will be hidden, thus increasing productivity and never procrastinate anymore! | |
// @author aimanb | |
// @grant none | |
// ==/UserScript== |
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
public class Login { | |
private static final String KEY_USERNAME = "username"; | |
private static final String KEY_PASSWORD = "password"; | |
private static final String KEY_DEVICEID = "deviceid"; | |
private static final String KEY_DEVICENAME = "devicename"; | |
private static final String KEY_NOTIFICATIONTOKEN = "notificationtoken"; | |
@SerializedName(KEY_USERNAME) | |
private String username; |
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
public class LoginResponse { | |
private static final String KEY_SUCCESS = "success"; | |
private static final String KEY_TOKEN = "token"; | |
@SerializedName(KEY_SUCCESS) | |
private int success; | |
@SerializedName(KEY_TOKEN) | |
private String token; |
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.myapp.core.data.network; | |
public class APIManager { | |
private static APIManager sInstance; | |
private final AppAPI mApi; | |
public static APIManager getInstance() { | |
if (sInstance == null) { |
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.myapp.core.data.network; | |
interface AppAPI { | |
// other API interface | |
//POST Login user | |
@POST("user/login") | |
Call<LoginResponse> loginUser(@Body Login login); |
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.myapp.core.mvp.home.login; | |
public interface LoginContract { | |
interface ViewAction{ | |
void onUserLogin(@NonNull Login login); | |
} | |
interface LoginView extends RemoteView { | |
void onLoginSuccess(); |
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.myapp.core.mvp.home.login; | |
public class LoginPresenter extends BasePresenter<LoginContract.LoginView> implements LoginContract.ViewAction { | |
private APIManager apiManager; | |
private PreferenceService preference; | |
private INetworkManager networkManager; | |
private Repository<Login> eventRepository; | |
public LoginPresenter(APIManager apiManager, PreferenceService preference, |