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 androidx.arch.core.executor.testing.InstantTaskExecutorRule | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MutableLiveData | |
import androidx.lifecycle.Observer | |
import org.junit.Assert.assertEquals | |
import org.junit.Rule | |
import org.junit.Test | |
//pattern inspired by https://github.com/ensody/ReactiveState-Kotlin, no code was copied. |
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
//from your application class, call | |
// new NavigationLogger().start(this); | |
//logs activity and fragment lifecycle events. | |
class NavigationLogger { | |
val logger = PVLog("Navigation") | |
fun start(app: Application) { | |
app.registerActivityLifecycleCallbacks(object: Application.ActivityLifecycleCallbacks { |
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
class VisualizerPainter extends CustomPainter { | |
final double position; | |
var noise = new SimplexNoise(); | |
NoiseLoop rLoop; | |
NoiseLoop gLoop; | |
NoiseLoop bLoop; | |
VisualizerPainter(this.position, this.rLoop, this.gLoop, this.bLoop); |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Arrow keys do stuff</h1> | |
<canvas id="myCanvas" width="800" height="400" | |
style="border:1px solid #d3d3d3;"> | |
Your browser does not support the HTML5 canvas tag.</canvas> | |
<script> | |
var c = document.getElementById("myCanvas"); |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="myCanvas" width="10000" height="1000" | |
style="border:1px solid #d3d3d3;"> | |
Your browser does not support the HTML5 canvas tag.</canvas> | |
<script> | |
var c = document.getElementById("myCanvas"); |
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
package com.lacronicus; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.animation.Interpolator; | |
import java.util.Random; | |
/** |
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
package com.lacronicus.combodriver; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
/** | |
* Created by fdoyle on 12/17/15. | |
*/ | |
public class ListenerCombiner { |
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
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> { |
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
package com.foo.ui.view; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Created by fdoyle on 11/2/15. | |
*/ |
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 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"); |
NewerOlder