Skip to content

Instantly share code, notes, and snippets.

View maxandersen's full-sized avatar
💭
; is so overrated

Max Rydahl Andersen maxandersen

💭
; is so overrated
View GitHub Profile
///usr/bin/env jbang "$0" "$@" ; exit $?
//PREVIEW
//JAVA 23+
//JAVAC_OPTIONS -proc:full -s gensrc
//DEPS cc.jilt:jilt:1.6.1
import static java.lang.System.*;
import java.sql.Date;
///usr/bin/env jbang "$0" "$@" ; exit $?
//PREVIEW
//JAVA 23+
//JAVAC_OPTIONS -proc:full -s gensrc
//DEPS cc.jilt:jilt:1.6.1
import static java.lang.System.*;
import java.sql.Date;
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
// 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:3.15.1}@pom
//DEPS io.quarkus:quarkus-picocli
//DEPS io.quarkus:quarkus-rest-client-jackson
//Q:CONFIG quarkus.banner.enabled=false
//Q:CONFIG quarkus.log.level=WARN
//Q:CONFIG quarkus.rest-client.analytics-engine.url=https://api.cloudflare.com/client/v4/accounts/
jbang https://github.com/parttimenerd/jfrtofp-server/releases/download/latest/jfrtofp-server-0.0.2-SNAPSHOT-all.jar %{https://github.com/parttimenerd/jfrtofp-server/raw/main/samples/flight.jfr}
@maxandersen
maxandersen / bob-jbang.gpt
Last active February 19, 2024 07:39
run this using gptscript.ai with jbang installed
Tools: bob
Ask Bob how he is doing and let me know exactly what he said.
---
Name: bob
Description: I'm Bob, a friendly guy.
Args: question: The question to ask Bob.
#!jbang --jsh
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
body {margin: 0; padding: 10px; background-color: #ffffff}
h1 {margin: 5px 0 0 0; font-size: 18px; font-weight: normal; text-align: center}
header {margin: -24px 0 5px 0; line-height: 24px}
button {font: 12px sans-serif; cursor: pointer}
p {margin: 5px 0 5px 0}
Overall, the `devhelper.java` file combines Quarkus, LangChain4j, and custom tools to provide an interactive and AI-powered assistance experience for developers working on the project.
Please enter your question:
could you generate a readme.adoc to introduce the project?
Thinking...
2024-01-09 10:22:15,230 ERROR [io.qua.lan.run.too.QuarkusToolExecutor] (main) com.fasterxml.jackson.databind.JsonMappingException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
at [Source: (String)"{
"filename": "README.adoc",
"content": "= Project README\n\nThis project is a development helper tool that uses Quarkus and LangChain4j to provide assistance in understanding and updating code.\n\n## Usage\n\nTo run the project, you need to have Java 17 or later installed on your machine.\n\n1. Clone the repository\n2. Open a terminal and navigate to the project directory\n3. Run the following command:\n\n ```
jbang devhelper.java
```\n\n This will sta
Connected to the target VM, address: 'localhost:4004', transport: 'socket'
'void java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object)'->java.base/java.lang.Thread.getStackTrace(Thread.java:2450)
java.base/java.lang.NoSuchMethodError.<init>(NoSuchMethodError.java:57)
java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:962)
java.base/java.lang.invoke.MemberName$Factory.resolveOrNull(MemberName.java:1006)
java.base/java.lang.invoke.InvokerBytecodeGenerator.resolveFrom(InvokerBytecodeGenerator.java:647)
java.base/java.lang.invoke.InvokerBytecodeGenerator.lookupPregenerated(InvokerBytecodeGenerator.java:699)
java.base/java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCode(InvokerBytecodeGenerator.java:708)
java.base/java.lang.invoke.LambdaForm.compileToBytecode(LambdaForm.java:849)
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
//PREVIEW
//JAVAC_OPTIONS -parameters
//DEPS io.quarkus.platform:quarkus-bom:3.6.3@pom
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-openai:0.4.0
//DEPS io.quarkus:quarkus-picocli
//Q:CONFIG quarkus.banner.enabled=false
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 21+
//PREVIEW
//JAVAC_OPTIONS -parameters
//DEPS io.quarkus.platform:quarkus-bom:3.5.1@pom
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-openai:999-SNAPSHOT
//DEPS io.quarkus:quarkus-picocli
//Q:CONFIG quarkus.banner.enabled=false