Skip to content

Instantly share code, notes, and snippets.

@ffissore
ffissore / README.md
Last active November 10, 2023 16:52
Enum equality

Download the files

Files starting with subpackage_ must be stored in the subpackage folder

The resulting files tree should look like

$ find
.
./myapp
./myapp/__init__.py
@ffissore
ffissore / jshell-wrapper
Last active September 19, 2023 10:21
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
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
@ffissore
ffissore / ThreadLocalTest.java
Created October 29, 2018 16:17
ThreadLocal and CompletableFuture
package com.example;
import org.junit.Test;
import java.util.concurrent.CompletableFuture;
public class ThreadLocalTest {
@Test
public void name() {
@ffissore
ffissore / Shutdown.coffee
Created March 7, 2012 14:00
Shutdown.coffee
parser = require("../connection/parser")
OperationTypes = require("./operation_types")
class Shutdown
read: (data, callback) ->
status = data.readUInt8(0)
if status
callback(data)
return