Skip to content

Instantly share code, notes, and snippets.

aemxn /
Created Aug 23, 2017
API interface
interface AppAPI {
// other API interface
//POST Login user
Call<LoginResponse> loginUser(@Body Login login);
public class APIManager {
private static APIManager sInstance;
private final AppAPI mApi;
public static APIManager getInstance() {
if (sInstance == null) {
aemxn /
Created Aug 23, 2017
LoginResponse model
public class LoginResponse {
private static final String KEY_SUCCESS = "success";
private static final String KEY_TOKEN = "token";
private int success;
private String token;
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";
private String username;
aemxn / hide-timeline.user.js
Last active Apr 16, 2017
[UserScript] Hide Facebook news feed
View hide-timeline.user.js
// ==UserScript==
// @name Hide Yo' Feed
// @namespace
// @include https://*
// @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==
aemxn / fcm-test.php
Last active Feb 28, 2017
Simple FCM push notification PHP snippet
View fcm-test.php
$to =
$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=\"\">",
aemxn /
Created Jul 4, 2016 — forked from eluleci/
Android: Helper for Android for selecting image from gallery, taking a photo with camera and cropping image.
import android.content.Intent;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
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;
aemxn /
Created Oct 28, 2015
Internet speed test python cli
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2015 Matt Martz
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
aemxn / index.php
Created Jul 5, 2015
View index.php
* (Authorization header with api key is required for user session)
* /register
* method - post
* params - name, email, password