Skip to content

Instantly share code, notes, and snippets.

View mcupak's full-sized avatar

Miro Cupak mcupak

View GitHub Profile
@mcupak
mcupak / devoxxua.jsh
Created November 24, 2018 10:05
JShell transcript from my Exploring what's new in Java in 2018 session at Devoxx Ukraine 2018.
List<Integer> list = new ArrayList<Integer>()
list.add(1)
list.add(2)
list.add(3)
list = Collections.unmodifiableList(list)
List<Integer> list2 = new ArrayList<Integer>(list)
list2.add(4)
List<Integer> list2 = Collections.unmodifiableList(new ArrayList<Integer>(list))
List<Integer> list = List.of(1,2,3)
list.add(4)
@mcupak
mcupak / thessaloniki.jsh
Created November 20, 2018 12:59
JShell transcript from my Reactive programming in Java session at VoxxedDays Thessaloniki 2018.
Thread t = new Thread(() -> System.out.println("hello thessaloniki"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello thessaloniki")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello thessaloniki")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / devoxx.jsh
Created November 15, 2018 20:44
JShell transcript from my Exploring reactive programming with Java session at Devoxx Belgium 2018.
Thread t = new Thread(() -> System.out.println("hello devoxx"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello devoxx")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello devoxx")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / voxxed-bristol-clean-code.jsh
Created November 8, 2018 10:27
JShell transcript from the Writing clean code with Java session at VoxxedDays Bristol 2018.
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
/list
/l
/help
Set<String> set = new HashSet<String>()
@mcupak
mcupak / voxxed-bristol-reactive.jsh
Created November 8, 2018 10:26
JShell transcript from the Exploring reactive programming in Java session at VoxxedDays Bristol 2018.
Thread t = new Thread(() -> System.out.println("hello bristol"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello bristol")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello bristol")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / devfest.jsh
Created November 8, 2018 10:06
JShell transcript from the Exploring reactive programming in Java session at DevFest Toulouse 2018.
Thread t = new Thread(() -> System.out.println("hello devfest"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello devfest")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello devfest")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / geecon.jsh
Created October 19, 2018 09:37
JShell transcript from the talk Pushing boundaries of types with modern Java at GeeCON Prague 2018.
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/methods
/types
int inc(int x) { return x+1; }
inc(4)
class MyClass { static void hello() {System.out.println("hello geecon"); } }
@mcupak
mcupak / voxxed-athens.jsh
Created June 1, 2018 11:28
JShell transcript from the talk Writing clean code with Java 9+ at VoxxedDays Athens 2018.
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/methods
/types
/list
/l
/help
List<String> myList = new ArrayList<>()
Supplier<String> helloSupplier = new Supplier<String>() {
@Override
public String get() {
return "hello geecon";
}
}
class MyClass implements MyInterface {
@Override
public void abstractMethod() {
System.out.println("abstract method called");
}
}