Skip to content

Instantly share code, notes, and snippets.


Dale King dalewking

View GitHub Profile
dalewking / gist:947fb57e0916d24a397d
Created July 15, 2014 23:50
Build.gradle setup for running Robolectric
View gist:947fb57e0916d24a397d
buildscript {
repositories {
dependencies {
classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.+'
dalewking / CamCompatListView
Created June 6, 2014 16:11
Backwards compatible Contextual Action Mode
View CamCompatListView
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;
public class CamCompatListView extends ListView
public CamCompatListView(Context context)
dalewking / gist:5744791
Last active December 18, 2015 07:09
Example of streaming text data to client in Scala on Play Framework 2.1 using OutputStream. It took me a long time to figure out how to get this working, so in case it helps someone else, here it is. The >>> Enumerator.eof is very important other wise it hangs
View gist:5744791
def index = Action {
val output = Enumerator.outputStream
o =>
val out = new PrintWriter(new OutputStreamWriter(o, "utf8"), true)
for(i <- 1 to 5)
out.println(s"Hello $i")