Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Tabak jacobtabak

View GitHub Profile
View Game.kt
package me.tabak.jacob.war
class Game(private val deck1: Deck, private val deck2: Deck) {
fun play() : Int {
println("Starting game!")
printDecks()
var winner = 0
while (deck1.isNotEmpty() && deck2.isNotEmpty()) {
winner = battle()
}
View AutoValueTypeAdapterFactory.java
package com.dramafever.common.gson;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
public final class AutoValueTypeAdapterFactory implements TypeAdapterFactory {
private static final String AUTOVALUE_PREFIX = "AutoValue_";
@jacobtabak
jacobtabak / PicassoVideoFrameRequestHandler.java
Last active Mar 11, 2017
Picasso Video Frame RequestHandler
View PicassoVideoFrameRequestHandler.java
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Request;
import com.squareup.picasso.RequestHandler;
import java.io.IOException;
View PersistentCookieStore.java
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import java.io.*;
import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.net.URISyntaxException;