Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
; is so overrated

Max Rydahl Andersen maxandersen

💭
; is so overrated
View GitHub Profile
View GameOfLife.java
//DEPS org.openjfx:javafx-controls:11.0.2:${os.detected.jfxname}
//DEPS org.openjfx:javafx-graphics:11.0.2:${os.detected.jfxname}
//DESCRIPTION: Game Of Life with JavaFX
//DESCRIPTION: From https://steemit.com/programming/@satoshio/conway-s-game-of-life-implementation-in-javafx
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
View listapi.jsh
//DEPS org.eclipse.collections:eclipse-collections-api:10.4.0
//DEPS org.eclipse.collections:eclipse-collections:10.4.0
import org.eclipse.collections.impl.factory.*;
var list = Lists.immutable.of(1,2,3,4,5,6,7,8,9).collect(i -> i*i);
// [1, 4, 9, 16, 25, 36, 49, 64, 81]
list.get(0) // 1
list.getFirst() // 1
View HelloPhysics.java
//DEPS org.jmonkeyengine:jme3-core:3.4.0-stable
//DEPS org.jmonkeyengine:jme3-desktop:3.4.0-stable
//DEPS org.jmonkeyengine:jme3-lwjgl:3.4.0-stable
//DEPS org.jmonkeyengine:jme3-testdata:3.4.0-stable
//DEPS org.jmonkeyengine:jme3-jbullet:3.4.0-stable
package jme3test.helloworld;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.TextureKey;
View test.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS https://github.com/maxandersen/fluent-process/tree/shell
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.ongres.process.FluentProcess.$;
public class test {
public static void main(String... args) {
View demo.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.zeroturnaround:zt-exec:1.12
//DEPS org.slf4j:slf4j-nop:1.7.30
import static java.lang.System.*;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import org.zeroturnaround.exec.*;
View AlbumImages.java
class AlbumImages {
public String image_id;
public String user_id;
public String albumId;
}
View diagramscode.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.diagramsascode:diagramsascode-image:0.1.2
import java.io.File;
import java.io.IOException;
import org.diagramsascode.core.Diagram;
import org.diagramsascode.image.SequenceDiagramImage;
import org.diagramsascode.sequence.constraint.SequenceDiagramConstraints;
import org.diagramsascode.sequence.edge.Message;
View db.java
///usr/bin/env jbang "$0" "$@" ; exit $?
// Update the Quarkus version to what you want here or run jbang with
// `-Dquarkus.version=<version>` to override it.
//DEPS io.quarkus:quarkus-bom:${quarkus.version:1.11.3.Final}@pom
//DEPS io.quarkus:quarkus-picocli
//DEPS io.quarkus:quarkus-hibernate-orm-panache
//DEPS io.quarkus:quarkus-jdbc-postgresql
//DEPS org.postgresql:postgresql:42.2.14
//DEPS org.testcontainers:postgresql:1.15.2
//DEPS io.quarkus:quarkus-hibernate-orm
View ms.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//REPOS mavencentral
//REPOS ms=https://repo.microstream.one/repository/maven-public/
//DEPS one.microstream:storage.embedded:04.01.00-MS-GA
//DEPS one.microstream:storage.embedded.configuration:04.01.00-MS-GA
//DEPS one.microstream:filesystem.sql:04.01.00-MS-GA
//DEPS org.postgresql:postgresql:42.2.14
//DEPS org.testcontainers:postgresql:1.15.2
//DEPS org.slf4j:slf4j-simple:1.7.25
View home-assistant (1).log
2021-02-07 00:19:04 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=logger, service=set_default_level>
2021-02-07 00:19:04 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=logger, service=set_level>
2021-02-07 00:19:04 INFO (MainThread) [homeassistant.setup] Setup of domain logger took 0.0 seconds
2021-02-07 00:19:04 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=logger>
2021-02-07 00:19:04 INFO (MainThread) [homeassistant.setup] Setting up http
2021-02-07 00:19:04 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds
2021-02-07 00:19:04 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=http>
2021-02-07 00:19:04 INFO (MainThread) [homeassistant.setup] Setting up system_log
2021-02-07 00:19:04 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=system_log, service=clear>
2021-02-07 00