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 / PlayFramework-Scala
Created August 7, 2014 15:34
PlayFramework-Scala
Routes configures in *conf/routes*
Controllers reside in *app/controllers/*
@mitchwongho
mitchwongho / activator-play-debug
Created August 21, 2014 10:09
Run Activiator-PlayFramework in debug mode
$ ./activator -jvm-debug <port> run
<port> is typically 9999
@mitchwongho
mitchwongho / Log.java
Last active August 29, 2015 14:07
Convenience android.util.Log wrapper
package com.utils;
/**
* Convenience Log wrapper
*/
public class Log {
public static void d( final String tag, final String msg, final Object... vargs ) {
android.util.Log.d( tag, String.format( msg, vargs ) );
}
public static void d( final String tag, final String msg, final Throwable throwable, final Object... vargs ) {
@mitchwongho
mitchwongho / bash
Created October 15, 2014 09:44
Eport Android Debug Key hash
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
@mitchwongho
mitchwongho / gist:84436cbd63b796172aa0
Created November 14, 2014 01:24
openname-verification
Verifying that +mitchwongho is my openname (Bitcoin username). https://onename.io/mitchwongho
@mitchwongho
mitchwongho / mesos-docker
Last active March 1, 2017 19:28
Mesosphere Docker Run Commands
# ZooKeeper
$ sudo docker run --net=host jplock/zookeeper:3.4.6
#Mesos-Master
## It's important to specify --ip=<ip> and --hostname=<ip> parameters
$ sudo docker run --net=host mesosphere/mesos-master:0.21.0-1.0.ubuntu1404 --ip=10.42.0.1 --hostname=10.42.0.1 --zk=zk://10.42.0.1:2181/mesos --work_dir=/opt/ --quorum=1
#Mesosphere-Marathon
@mitchwongho
mitchwongho / 1README.md
Last active June 1, 2018 14:24
Implement CORS Request Headers in PlayFramework 2.3.x Applications

Introduction

I recently needed to apply CORS (Cross Origin Request Scripting) to a project that I'm working on. If found 2 posts that helped to achieve it:

I combined both to solve my problem: I have a User CRUD (Play!) webservice and a (Play!) web app that services a SPA (Single Page Application). The SPA needs to access the CRUD webservice, but to acheive this, I would need to apply some CORS rules on both applications.

Files

@mitchwongho
mitchwongho / essential_scala.md
Last active May 16, 2016 05:52
Essential Scala - Notes

Essential Scala - Notes

Classes, Objects and Traits

/* A class is an abstraction over objects */
/* constructor args declared using val to expose publicly and can declare default values */
class Foo(val arg1: Long, val arg1: Double, val arg3: Int = 0) {
  val someValue: Int = ??? /* public, immutable */
  var someVariable: Long = ??? /* public, mutable */
@mitchwongho
mitchwongho / r-prog.md
Last active August 29, 2015 14:12
R Programming

R Programming

Google's R Style Guide https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml

# This is a comment

# Get current working directory
> getwd()
@mitchwongho
mitchwongho / jenkins-android-1
Last active August 29, 2015 14:21
Android CI with Jenkins
# Android CI with Jenkins
## Introduction
todo
## Tools/Plugins
The following is a list of plugins used on Jenkins:
- Android Emulator Plugin
- Bitbucket Approve Plugin
- Bitbucket OAuth Plugin