Skip to content

Instantly share code, notes, and snippets.

Tianxing Li nex3z

Block or report user

Report or block nex3z

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
nex3z / docker-compose.yml
Created May 20, 2019
docker-compose elasticsearch kibana
View docker-compose.yml
version: '3.7'
container_name: es01
- discovery.type=single-node
- bootstrap.memory_lock=true
nex3z / EnumConverter.kt
Created Dec 12, 2017
Kotlin Enum with Custom Property and Converter
View EnumConverter.kt
abstract class EnumConverter<in V, E: Enum<E>>(
private val valueMap: Map<V, E>
) {
fun fromValue(value: V): E? = valueMap[value]
fun fromValue(value: V?, default: E): E = valueMap[value] ?: default
inline fun <V, reified E: Enum<E>> buildValueMap(keySelector: (E) -> V): Map<V, E> =
public class Singleton {
private Singleton() {}
private static class Holder {
private static final Singleton INSTANCE = new Singleton();
public static Singleton getInstance() {
return Holder.INSTANCE;
static class MyHandler extends Handler {
private final WeakReference<MyActivity> mRef;
MyHandler(MyActivity activity) {
mRef = new WeakReference<HomeActivity>(activity);
public void handleMessage(Message msg) {
MyActivity activity = mRef.get();
View codec.cs
// hello 你好
// hello 浣犲ソ
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class SimpleObserver extends ContentObserver {
private static final String LOG_TAG = SimpleObserver.class.getSimpleName();
public SimpleObserver(Handler handler) {
public void onChange(boolean selfChange) {
this.onChange(selfChange, null);
View TMDb JSON sample
"overview":"Thirty years after defeating the Galactic Empire, Han Solo and his allies face a new threat from the evil Kylo Ren and his army of Stormtroopers.",
You can’t perform that action at this time.