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 / slide_in_bottom.xml
Created March 7, 2014 12:01
Android anim to animate a view sliding in from the bottom. Companion to slide_out_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="100%p" android:toYDelta="0%p" android:duration="600"/>
<alpha android:fromAlpha="5.0" android:toAlpha="1.0" />
</set>
@mitchwongho
mitchwongho / slide_out_bottom.xml
Created March 7, 2014 12:02
Android anim to animate a view sliding in from the bottom. Companion to slide_in_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%p" android:toYDelta="100%p" android:duration="600"/>
<alpha android:fromAlpha="1.0" android:toAlpha="5.0" />
</set>
@mitchwongho
mitchwongho / gist:9524857
Last active August 29, 2015 13:57
Android ProTip: AsyncTask info
Beginning with Android 3.0 (API level 11), an extra feature is available in AsyncTask
so you can enable it to run across multiple processor cores. Instead of calling execute()
you can specify executeOnExecutor() and multiple requests can be executed at the same time
depending on the number of cores available.
@mitchwongho
mitchwongho / CropCircleTransformation.java
Created April 7, 2014 21:00
A Bitmap transformation used with Picasso to product round/circular-cropped bitmaps
package com.goald.twooceans.util;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
@mitchwongho
mitchwongho / vaadin_spring_tomcat.txt
Last active August 29, 2015 14:01
SpringVaadinIntegration ad-on
add-on : http://vaadin.xpoft.ru/
Issues:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
see: http://stackoverflow.com/questions/6210757/java-lang-classnotfoundexception-org-springframework-web-context-contextloaderl
@mitchwongho
mitchwongho / jenkins.config
Last active August 29, 2015 14:04
Jenkins config
# Android SDK update
(for i in {1..30}; do echo y; sleep 1; done) | /opt/android/android-sdk-linux/tools/android update sdk -u -a
@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