Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
; is so overrated

Max Rydahl Andersen maxandersen

💭
; is so overrated
View GitHub Profile
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
View gist:bb9bd98e3627ca9594ee0f239cf65843
{
"originalResource": "https://gist.githubusercontent.com/maxandersen/0c800113d6e29b0b571544003221439a/raw/66b4fa39791c1ef6e211c882877f57addd935aed/EventResource.java",
"backingResource": "/Users/max/.jbang/cache/urls/87ee0c011e4f260e2b254f179926e69df999355760e50f75d606af4f09b0fe05/EventResource.java",
"resolvedDependencies": [
"/Users/max/.m2/repository/io/quarkus/quarkus-scheduler/1.11.0.Final/quarkus-scheduler-1.11.0.Final.jar",
"/Users/max/.m2/repository/io/quarkus/quarkus-arc/1.11.0.Final/quarkus-arc-1.11.0.Final.jar",
"/Users/max/.m2/repository/io/quarkus/arc/arc/1.11.0.Final/arc-1.11.0.Final.jar",
"/Users/max/.m2/repository/jakarta/enterprise/jakarta.enterprise.cdi-api/2.0.2/jakarta.enterprise.cdi-api-2.0.2.jar",
"/Users/max/.m2/repository/jakarta/el/jakarta.el-api/3.0.3/jakarta.el-api-3.0.3.jar",
"/Users/max/.m2/repository/jakarta/interceptor/jakarta.interceptor-api/1.2.5/jakarta.interceptor-api-1.2.5.jar",
View EventResource.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus:quarkus-bom:1.11.0.Final@pom
//DEPS io.quarkus:quarkus-scheduler
//DEPS io.quarkus:quarkus-smallrye-reactive-messaging-kafka
//DEPS io.quarkus:quarkus-resteasy-reactive-jackson
//DEPS io.quarkus:quarkus-reactive-pg-client
//DEPS io.quarkus:quarkus-hibernate-reactive
//DEPS org.projectlombok:lombok:1.18.12
// //SOURCES **/*.java
//FILES application.properties
@maxandersen
maxandersen / HotSwapDemo.java
Last active Jan 20, 2021
Example on jbang enabling graalvm -truffle / espresso feature
View HotSwapDemo.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA_OPTIONS -truffle
//`-truffle` is there to enable graalvm espresso.
// See https://medium.com/graalvm/java-on-truffle-going-fully-metacircular-215531e3f840
// with sdman you can do the following to install:
// sdk install java 21.0.0.r11-grl
// gu install espresso
// gu install native-image ## optional
View speedtest.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.5.0
//DEPS fr.bmartel:jspeedtest:1.32.1
//DEPS me.tongfei:progressbar:0.9.0
//DEPS commons-io:commons-io:2.6
import static java.lang.System.out;
import java.net.URL;
View MyFirstRobot.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//REPOS jitpack
//DEPS com.github.ev3dev-lang-java:ev3dev-lang-java:2.4.16
package examples;
import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;
import ev3dev.sensors.Battery;
import lejos.hardware.port.MotorPort;
import lejos.utility.Delay;
View dataframes.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.5.0
//DEPS org.slf4j:slf4j-nop:1.7.30
//DEPS org.datavec:datavec-local:1.0.0-beta7
//DEPS joinery:joinery-dataframe:1.9
//DEPS org.apache.poi:poi:4.1.2
//DEPS tech.tablesaw:tablesaw-core:0.38.1
View twitterth.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus:quarkus-picocli:1.8.1.Final
//Q:CONFIG quarkus.banner.enabled=false
//Q:CONFIG quarkus.log.level=WARN
//DEPS org.twitter4j:twitter4j-core:4.0.7
//JAVA 11+
import picocli.CommandLine;
import javax.enterprise.context.Dependent;