Skip to content

Instantly share code, notes, and snippets.

View mitchwongho's full-sized avatar
:atom:
Build > Test > Deploy

Mitchell Wong Ho mitchwongho

:atom:
Build > Test > Deploy
View GitHub Profile
@mitchwongho
mitchwongho / blockstack.id
Created November 10, 2017 18:15
Blockstack ID Github verification
Verifying my Blockstack ID is secured with the address 12fmp8MHaSmzZbR3iu77hysmd9C5zpLKPs https://explorer.blockstack.org/address/12fmp8MHaSmzZbR3iu77hysmd9C5zpLKPs
package com.mitchwongho.test.observablerealms.realms;
import android.support.annotation.NonNull;
import java.util.UUID;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
/**
@mitchwongho
mitchwongho / ObservableRealms.java
Created November 24, 2016 09:21
I text app to exercise Observable RealmResults
package com.mitchwongho.test.observablerealms;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.mitchwongho.test.observablerealms.realms.Person;
import java.util.concurrent.TimeUnit;
@mitchwongho
mitchwongho / osmc_expressvpn_openvpn.md5
Last active January 27, 2024 17:06
Setting Up TunnelBear or ExpressVPN (using OpenVPN) On OSMC
# Setting Up ExpressVPN (OpenVPN) On OSMC
## References
- [Brian Hornsby' Kodi OpenVPN plugin](http://brianhornsby.com/blog/how-to-setup-your-vpn-client)
- [Install and Configure OpenVPN on OSMC/Kodi](https://nerddrivel.com/2016/03/25/install-and-configure-openvpn-on-osmckodi/)
- [ExpressVPN - High speed, ultra secure, and easy to use. Instant setup.](https://www.expressvpn.com/)
- [[HOWTO] OSMC/Rasp Pi as OpenVPN client](https://discourse.osmc.tv/t/howto-osmc-rasp-pi-as-openvpn-client/1844/71)
## Steps
@mitchwongho
mitchwongho / RealmObjectFetchOnSubscribe.java
Created February 18, 2016 13:09
RealmResult Observable
package com.github.mitchwongho.android.beacon.database.rx;
import android.content.Context;
import android.support.annotation.NonNull;
import io.realm.Realm;
import io.realm.RealmChangeListener;
import io.realm.RealmObject;
import io.realm.RealmResults;
import rx.Observable;
@mitchwongho
mitchwongho / build.gradle
Last active August 1, 2016 15:15
Kotlin Android build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'me.tatarka.retrolambda'
buildscript {
ext.kotlin_version = '1.0.0-beta-4584'
ext.android_support_lib_version = '23.1.1'
ext.retrolambda_version = '3.2.4'
repositories {
jcenter()
@mitchwongho
mitchwongho / pseudo-enum.java
Created October 28, 2015 08:22
A enum replacement
import com.google.auto.value.AutoValue;
/**
*
*/
@AutoValue
public abstract class PseudoEnum {
public static PseudoEnum MONDAY() {
return new AutoValue_PseudoEnum(0);
@mitchwongho
mitchwongho / DoubleEpsilonCompare.java
Created October 16, 2015 11:01
An example of comparing two double values with an epsilon.
/**
* Compare two {@code double} values
* @param a some <i>double</i> value
* @param b some other <i>double</i> value
* @return {@code true} if the two values are equal
*/
public static boolean equals (final double a, final double b) {
if (a==b) return true;
return Math.abs(a - b) < EPSILON; //EPSILON = 0.0000001d
}
@mitchwongho
mitchwongho / jenkins-cloud.md
Last active August 29, 2015 14:22
Jenkins Installation Notes

Jenkins Installation Notes

The purpose of this gist is to capture the installation steps used to install Jenkins "in the cloud".

The Goal

The goal of this exercise is to host a Jenkins master in the cloud (OpenShift) and Jenkins slaves on AWS EC2.

Installation

Jenkins

Jenkins Master

@mitchwongho
mitchwongho / bash-tips.md
Last active August 29, 2015 14:22
Bash tricks

find file in decendants and assign to a variable as an array

$ paths=( $(find . -regex '.*/AndroidManifest.xml') )

reference paths elements

$ echo ${paths[0]} # element 0
$ echo ${paths[1]} # element 1
$ echo ${paths[@]} # flatmap