Skip to content

Instantly share code, notes, and snippets.

View fdoyle's full-sized avatar

Frank Doyle fdoyle

  • San Antonio, TX
View GitHub Profile
<!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");
@fdoyle
fdoyle / mario2.html
Last active April 5, 2017 22:43
fun little mario demo
<!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");
@fdoyle
fdoyle / noise.dart
Created April 2, 2019 19:54
some stuff for working with simplex noise in dart
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);
//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 {
@fdoyle
fdoyle / derived.kt
Created April 14, 2023 18:49
A cool way to do derivedState with LiveData
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.