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
function HTTP_Error(msg, status) { | |
var error = new Error(msg); | |
error.status = status; | |
return error; | |
} |
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.content.SharedPreferences; | |
import com.google.gson.Gson; | |
import com.google.gson.JsonArray; | |
import java.io.Serializable; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import java.util.ArrayList; |
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 abstract class ListViewAdapter <T> extends BaseAdapter { | |
protected ListView listView; | |
private ArrayList<T> objects = new ArrayList<T>(); | |
public void updateData(ArrayList<T> objects) { | |
this.objects = objects; | |
notifyDataSetChanged(); | |
} | |
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
<ListView | |
android:id="@+id/list_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:animationCache="false" | |
android:cacheColorHint="@color/transparent" | |
android:divider="@color/transparent" | |
android:dividerHeight="0dp" | |
android:listSelector="@color/transparent" | |
android:scrollingCache="false"/> |
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 enum HttpStatus { | |
UNAUTHORIZED(401), | |
FORBIDDEN(403), | |
NOT_FOUND(404), | |
OTHER_ERROR(null); | |
private static HashMap<Integer, HttpStatus> map; | |
private Integer code; |
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 GcmUtil { | |
public static String getToken(Context context) throws IOException { | |
InstanceID instanceID = InstanceID.getInstance(context); | |
return instanceID.getToken(context.getString(R.string.gcm_defaultSenderId), | |
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); | |
} | |
public static String getTokenOnThread(final Context context) { | |
try { |
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
<style type="text/css"> | |
.img_fitted { | |
background-position: center; | |
background-size:cover; | |
width: 100%; | |
color: #fff; | |
} | |
.img_fitted img { | |
max-width: 100%; |
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 java.util.Random; | |
public class UniqueIdUtility { | |
static private int id; | |
static { | |
id = Integer.MIN_VALUE + new Random().nextInt(Integer.MAX_VALUE); | |
} |
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
protected void logStackTrace() { | |
(new Throwable()).printStackTrace(); | |
} |
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
module FacebookLoginHelper | |
def login_with_facebook | |
return unless fetch_fb_profile | |
setup_user_by_fb | |
create_token_info | |
set_token_on_user | |
if User.devise_modules.include?(:confirmable) |
OlderNewer