This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.compat._ | |
object TestCollection extends App { | |
var rec = 0 | |
def llRange(lo: Int, hi: Int): immutable.LazyList[Int] = { | |
rec = rec + 1 | |
if (lo >= hi) immutable.LazyList.empty | |
else immutable.LazyList.cons(lo, llRange(lo + 1, hi)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.{Applicative, Monad} | |
import freestyle.tagless._ | |
import freestyle.tagless.logging.LoggingM | |
import scala.util.Try | |
@tagless trait MyService1[F[_]] { | |
def method1(string: String): F[Int] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import troy.cql.ast._ | |
import troy.schema._ | |
val sql = | |
""" | |
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': '1'}; | |
CREATE TABLE test.posts ( | |
author_id text, | |
post_id timeuuid, | |
post_title text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.PorterDuff | |
import android.graphics.PorterDuffXfermode | |
import android.graphics.Rect | |
import com.squareup.picasso.Transformation | |
class CircularTransformation(size: Int) extends Transformation { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Support Library | |
-keep class android.support.v4.app.** { *; } | |
-keep interface android.support.v4.app.** { *; } | |
# Simple Framework | |
-dontwarn org.simpleframework.xml.stream.Stream* | |
-keep class org.simpleframework.xml.**{ *; } | |
# Butterknife | |
-dontwarn butterknife.internal.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.text.TextUtils; | |
public class IntentLauncher { | |
public static class IntentLauncherException extends Exception { | |
public IntentLauncherException(String detailMessage) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SignUpActivity extends Activity { | |
private final ObjectGraph childOg; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState): | |
ExampleApp app = (ExampleApp) getApplication(); | |
ObjectGraph og = app.getObjectGraph(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AndroidBus extends Bus { | |
private final Handler mainThread = new Handler(Looper.getMainLooper()); | |
@Override | |
public void post(final Object event) { | |
if (Looper.myLooper() == Looper.getMainLooper()) { | |
super.post(event); | |
} else { | |
mainThread.post(new Runnable() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Parcel; | |
import android.os.Parcelable; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
public final class ParcelableUtil { | |
private ParcelableUtil() { |