Skip to content

Instantly share code, notes, and snippets.

Fung LAM seventhmoon

Block or report user

Report or block seventhmoon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@seventhmoon
seventhmoon / CachedDrmSessionManager.java
Last active Dec 1, 2016
CachedDrmSessionManager for Exoplayer offline playback use
View CachedDrmSessionManager.java
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@seventhmoon
seventhmoon / OkHttpStack.java
Created Dec 23, 2015
OkHttpStack for Volley
View OkHttpStack.java
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
@seventhmoon
seventhmoon / GsonRequest.java
Created Jan 4, 2016
GsonRequest for Volley
View GsonRequest.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonRequest;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@seventhmoon
seventhmoon / Connectivity.java
Created Jan 4, 2016
Connectivity helper for Android
View Connectivity.java
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
*
* @author emil http://stackoverflow.com/users/220710/emil
View CursorRecyclerViewAdapter.java
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@seventhmoon
seventhmoon / readme.md
Created Feb 17, 2017
Skygear Server Installation (Debian / Ubuntu)
View readme.md
apt-get install postgresql
apt-get install golang
apt-get install postgis
apt-get install postgresql-client
apt-get install postgresql-contrib
apt-get install software-properties-common
apt-get install vim
apt-get install redis-server
service postgresql start
@seventhmoon
seventhmoon / RecordHelper.java
Last active Feb 21, 2017
Helper function for casting / parsing Record when using Skygear
View RecordHelper.java
import com.google.gson.Gson;
import java.util.Map;
import io.skygear.skygear.Record;
public class RecordHelper {
public static <T> T toObject(Record record, Class<T> classOfT) {
@seventhmoon
seventhmoon / RecordSerializer.java
Last active Feb 21, 2017
Gson Serializer for Skygear Record
View RecordSerializer.java
package org.astri.isns.elderly;
import com.google.gson.JsonElement;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
import java.util.Map;
import io.skygear.skygear.Record;
@seventhmoon
seventhmoon / okio_proguard.pro
Created Mar 14, 2017
ProGuard Configurations
View okio_proguard.pro
-dontwarn okio.**
View layout.xml
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:flexWrap="wrap"
android:layout_gravity="center"
app:alignItems="center"
tools:context="com.androidfung.layoutsample.MainActivity">
You can’t perform that action at this time.