Skip to content

Instantly share code, notes, and snippets.

View fdoyle's full-sized avatar

Frank Doyle fdoyle

  • San Antonio, TX
View GitHub Profile
@fdoyle
fdoyle / gist:9397785
Created March 6, 2014 19:42
"asyncObservable" example
package com.example.retrofitdemo3;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.example.retrofitdemo3.api.NobelApi;
import com.example.retrofitdemo3.api.NobelService;
package crub.the.flub
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ListView;
/**
* Created by fdoyle on 3/19/14.
#!/bin/bash
VIDEO_LENGTH="10"
VIDEO_NAME="gifme.mp4"
GIF_NAME="gifme.gif"
GIF_OPTIMIZED_NAME="gifme-optimized.gif"
VIDEO_PATH="/sdcard/"$VIDEO_NAME
LOCAL_VIDEO_PATH="./"$VIDEO_NAME
@fdoyle
fdoyle / gist:024ff17b6550b4acf9ad
Created September 5, 2014 14:32
a thing that doesn't render the top N pixels of a listview.
package com.derp.android
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.util.AttributeSet;
import android.widget.ListView;
@fdoyle
fdoyle / gist:6f9f8d217565d7fea4fd
Last active August 29, 2015 14:09
PullToRefreshLayout - Because guidelines are for scrubs.
package com.derp.android.view;
import android.animation.Animator;
import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@fdoyle
fdoyle / Optional.java
Created March 21, 2015 03:02
Optional Type Adapter for Gson (using the Optional gist located elsewhere)
package com.derp.gsonoptional;
/**
* Created by fdoyle on 3/20/15.
*/
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
@fdoyle
fdoyle / gist:878969b3e485c675c034
Created March 23, 2015 15:48
Reveal animation, bound in framelayout, but works pre 5.0
package com.derp.revealanimationdemo;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
@fdoyle
fdoyle / Main.java
Created October 21, 2015 14:31
first stab at a graph deep copy
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
Node a = new Node("A","A");
Node b = new Node("B","B");
Node c = new Node("C","C");
Node d = new Node("D","D");
@fdoyle
fdoyle / kotlinlistmethods.kt
Created November 13, 2015 20:50
made these as an exercise, then found out they were in sequence. oh well.
package com.lacronicus.kotlinlistmethods
import java.util.ArrayList
/**
* Created by fdoyle on 11/13/15.
*/
fun <T, R> List<T>.map(mapFunc: (T) -> R) : List<R> {
package com.wta.videodemo;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.hardware.Camera;
import android.media.CamcorderProfile;
import android.media.MediaRecorder;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;