Skip to content

Instantly share code, notes, and snippets.

package org.geepawhill.contentment.geometry
import javafx.beans.property.SimpleDoubleProperty
import tornadofx.*
class AspectRatio {
val widthToHeightProperty = SimpleDoubleProperty(16.0 / 9.0)
var widthToHeight by widthToHeightProperty
val hostWidthProperty = SimpleDoubleProperty(0.0)
package org.geepawhill.contentment.jfx
import javafx.beans.property.Property
import javafx.beans.property.ReadOnlyProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableValue
import javafx.collections.ObservableList
import javafx.scene.transform.Scale
import javafx.scene.transform.Transform
package org.geepawhill.tsd.core
interface TsdWriter {
class IllegalKeyException(key: String, message: String) : RuntimeException("'$key' is not a legal tsd key, (${message}).")
class UnknownKeyException(key: String) : RuntimeException("`$key` not found in TSD")
operator fun set(key: String, value: String)
operator fun <T> set(key: String, value: T)
operator fun set(key: String, value: Tsd)
operator fun <T> set(key: String, collection: Collection<T>)
longMethod( int y ) {
int x;
x = 0;
// ...
// IRRELEVANCY #0: 87 lines that neither read nor write x
// ...
if( y == 17 ) {
x = 1;
}
// ...
package org.geepawhill.contentment.fragments;
import org.geepawhill.contentment.core.*;
import javafx.scene.Group;
/**
* Makes a group and adds it to the destination, making it available via get for later
* manipulators.
*
package org.geepawhill.contentment.fragments;
import static org.assertj.core.api.Assertions.assertThat;
import org.geepawhill.contentment.core.Context;
import org.geepawhill.contentment.rhythm.SimpleRhythm;
import org.junit.*;
public class SyncTest
{
@GeePawHill
GeePawHill / Box.java
Created April 3, 2018 02:33
A real-world TDD "what to do?"
/* This is the Box. Note that it's extremely similar to the Stroke, essentially only changing Stroke's behavior by making it
four-way instead of one-way. I see no other way to code it without re-factoring the four-level tree.
This is simple. I haven't run it yet, but I bet it runs.
Should I have tested it? The expense of testing it *without* the factoring is dauntingly high. The factoring is on the agenda, and
I know how to do it. But it will take a good deal of work, as Stroke and Box are part of a half-dozen entries at their level of the
tree, with another half-dozen at the third, and a good dozen at the fourth. (The top level isn't shown, and is actually the most
rational and composite-like.)
*/
package org.geepawhill.contentment.flow;
import static org.geepawhill.contentment.utility.JfxUtility.color;
import java.util.HashMap;
import java.util.Map;
import org.geepawhill.contentment.format.Format;
import org.geepawhill.contentment.style.Frames;
import org.geepawhill.contentment.style.TypeFace;
@GeePawHill
GeePawHill / gist:ee786e0a653893403be98f806a4559a1
Created January 9, 2018 19:41
My (Current 1\1\2018) Twenty-Five Most Beloved Novels
(In no particular order)
Nancy Willard -- Things Invisible To See
CJ Cherryh -- Cuckoo's Egg
David Foster Wallace -- Infinite Jest
John Sayles -- Pride of the Bimbos
George Eliot -- Middlemarch
Neal Stephenson -- Snow Crash
Vladimir Nabokov -- Lolita
Marilynn Robinson -- Housekeeping
@GeePawHill
GeePawHill / gist:df8fd05fd503098a1635d0a06b94c138
Created July 19, 2017 05:34
Fluent script code that's extensible by adding new things to build and extensible by adding new generic and custom builder API's with no dup.
package org.geepawhill.contentment.script;
public class FluentScriptBuilder
{
///////////////////////////////////////////////////////////////////////////////
// This class and following function just get a line started
static class MarkContext
{
// pretend convenience method for super-common agent-type 'Letters'.