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
@Ben-G
Ben-G / UserDefaultsWrapper.swift
Created April 12, 2017 02:04
User Defaults Wrapper Swift
/// A wrapper around `NSUserDefaults` access for settings that are specific to the PlanGrid app.
/// `NSUserDefaults` should always be accessed through this type, this way we have a good overview
/// of all the settings the app supports and we can document them.
@objc final class PlanGridUserDefaults: NSObject {
/// Keeps track of whether or not a user has already used the annotation filter feature.
static var hasUsedAnnotationFilterFeature = UserDefaultsProperty<Bool>("HasUsedAnnotationFilterFeature")
}
/// A property that wraps around a value that is persisted to NSUserDefaults.
@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();
}
@imminent
imminent / Api.java
Last active June 13, 2023 02:50
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 {
@jmaicher
jmaicher / Unit.java
Created December 11, 2012 10:06
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
}
});