Skip to content

Instantly share code, notes, and snippets.

View ashif-ismail's full-sized avatar
🎯
Focusing

Ashif Ismail ashif-ismail

🎯
Focusing
View GitHub Profile
@ashif-ismail
ashif-ismail / product_details.json
Created October 8, 2020 08:09
format for product details page
{
"data": {
"id": 1,
"type": "hotel",
"title": "Lounge Coffee Bar",
"subtitle": "Arts & Humanities",
"image": "assets/images/location-1.jpg",
"created_date": "Sep 15, 2019",
"rate": 4.5,
"num_rate": 676,
@ashif-ismail
ashif-ismail / ArduinoActivity.java
Created February 16, 2020 10:08
Java file to connect to Arduino and get and plot the sensor data in line graph
package me.ashif.smartrelay.activity;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.hardware.usb.UsbDevice;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
@ashif-ismail
ashif-ismail / DeviceOrientation
Created October 11, 2018 07:28 — forked from Abdelhady/DeviceOrientation
A utility class to help get current device orientation, you will need it if you decided to fix the activity's orientation in the manifest :)
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.ExifInterface;
/**
* Created by abdelhady on 9/23/14.
*
* to use this class do the following 3 steps in your activity:
@ashif-ismail
ashif-ismail / Api.java
Created May 9, 2018 08:08 — forked from imminent/Api.java
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {
@ashif-ismail
ashif-ismail / Api.java
Created May 9, 2018 08:08 — forked from imminent/Api.java
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {
@ashif-ismail
ashif-ismail / Unit.java
Created June 6, 2017 06:17 — forked from jmaicher/Unit.java
Unit testing anonymous inner classes as event listener
public class Unit {
public Unit(EventDispatcher dispatcher) {
dispatcher.addHandler(MyEvent.class, new IEventHandler() {
public void onEvent(MyEvent event) {
// some behavior
}
});
@ashif-ismail
ashif-ismail / TimeUtils.java
Created March 22, 2017 07:14
Java Utility class to handle various task's related to Date and Time ex:Time concersion and various others
/**
* Created by Ashif on 22/03/17.
*/
public class TimeUtils {
public static boolean isValidString(String string) {
return string != null && !string.isEmpty();
}