Google's R Style Guide https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml
# This is a comment
# Get current working directory
> getwd()
def tags = "git -C ${rootDir} tag".execute().text.trim() | |
def numTags = tags.tokenize('\n').size() | |
// Fetch the version according to git latest tag and "how far are we from last tag" | |
def longVersionName = "git -C ${rootDir} describe --tags --long".execute().text.trim() | |
def (fullVersionTag, versionBuild, gitSha) = longVersionName.tokenize('-') | |
def(versionMajor, versionMinor, versionPatch) = fullVersionTag.tokenize('.') | |
// Set the version name | |
versionName "$versionMajor.$versionMinor.$versionPatch" |
# 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 |
/* 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 */
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.
# 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 |
Verifying that +mitchwongho is my openname (Bitcoin username). https://onename.io/mitchwongho |
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 |
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 ) { |
$ ./activator -jvm-debug <port> run | |
<port> is typically 9999 |