Skip to content

Instantly share code, notes, and snippets.

@ffissore
ffissore / ThreadLocalTest.java
Created Oct 29, 2018
ThreadLocal and CompletableFuture
View ThreadLocalTest.java
package com.example;
import org.junit.Test;
import java.util.concurrent.CompletableFuture;
public class ThreadLocalTest {
@Test
public void name() {
@ffissore
ffissore / jshell-wrapper
Last active Jan 18, 2022
with jshell-wrapper you get runnable java scripts: it removes the heading shebang, adds an "/exit" for good measure, and passes the result to jshell
View jshell-wrapper
TMP=`mktemp`
tail -n +2 $@ >> $TMP
echo "/exit" >> $TMP
$JAVA_HOME/bin/jshell -q --execution local $TMP
rm $TMP
#put this file in /usr/local/bin/ or somewhere in your $PATH
View Shutdown.coffee
parser = require("../connection/parser")
OperationTypes = require("./operation_types")
class Shutdown
read: (data, callback) ->
status = data.readUInt8(0)
if status
callback(data)
return