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
View now331.json
//curl 'https://hkt-mobile-api.nowtv.now.com/09/1/getLiveURL' -H 'Accept: */*' -H 'Referer: https://news.now.com/home/live331a' -H 'Origin: https://news.now.com' -H 'User-Agent: Mozilla/5.0 (X11; CrOS x86_64 12105.75.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.102 Safari/537.36' -H 'Content-Type: application/json' --data-binary '{"channelno":"331","mode":"prod","audioCode":"","format":"HLS","callerReferenceNo":"20140702122500"}' --compressed
{"asset":{"hls":{"fix":{"2":["http://ewcdnsite06.nowe.com/session/09-66f7223b8ba659a79719d70a1aeee/Content/HLS/LIVE/Channel(HLS_CH331)/Stream(02)/index.m3u8?token=0425484f980b53d36d0293acc69c55b2_1562399934"],"1":["http://ewcdnsite06.nowe.com/session/09-66f7223b8ba659a79719d70a1aeee/Content/HLS/LIVE/Channel(HLS_CH331)/Stream(01)/index.m3u8?token=d3db0393451ab9b83b4d738376c7e979_1562399934"]},"adaptive":["http://ewcdnsite06.nowe.com/session/09-66f7223b8ba659a79719d70a1aeee/Content/HLS/LIVE/Channel(HLS_CH331)/index.m3u8?token=37c2269e3eff183d98c4c3084ac72060_
@seventhmoon
seventhmoon / Util.java
Created Feb 20, 2018
Helper Utility for Android
View Util.java
import android.content.Context;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;
import android.widget.Toast;
/**
* A collection of utility methods, all static.
*/
public class Utils {
@seventhmoon
seventhmoon / Util.java
Created Feb 20, 2018
Helper Utility for Android
View Util.java
import android.content.Context;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;
import android.widget.Toast;
/**
* A collection of utility methods, all static.
*/
public class Utils {
@seventhmoon
seventhmoon / SensorActivity
Created Mar 20, 2017
Sample for Reading Sensor Value on Android
View SensorActivity
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorEventListener2;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
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">
@seventhmoon
seventhmoon / okio_proguard.pro
Created Mar 14, 2017
ProGuard Configurations
View okio_proguard.pro
-dontwarn okio.**
@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 / 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 / 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
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
You can’t perform that action at this time.