life is too short for a diary




Daily Logs for July 20, 2025

Tags: letters jbang java

Author
Written by: Tushar Sharma

Dear Vishi, my logs for today.


How to write a good prompt

I listened to Jonathan Mast who advised on how to write a good prompt. He said instead of writing it ourself, we can use LLM to write it for us:

💬 Act as a Prompt Engineer, review the following prompt for me. optimize it to make it better and ask me any questions before proceedings: Your rough draft

How to open wsl folder on File Explorer

In your terminal, you can simply type explorer.exe .. Or you can also go to address bar of the Explorer and type \\wsl$.

Run Java like a Python script

JBang lets you run Java files like scripts, similar to how you run Python files. No project setup, no pom.xml, no build tools needed.

Install it using sdkman

sdk install jbang

Create a simple standalone script

//DEPS io.projectreactor:reactor-core:3.6.5

import reactor.core.publisher.Flux;

public class Test {
    public static void main(String[] args) {
        test1();
    }

    public static void test1() {
        Flux<Integer> nums = Flux.just(1, 2, 3, 4);

        nums.map(i -> i * 2)
            .collectList() // Converts to Mono<List<Integer>>
            .subscribe(result -> System.out.println("Doubled values: " + result));
    }
}

Run it like

jbang Test.java

comments powered by Disqus