Skip to content

Instantly share code, notes, and snippets.

View lutovich's full-sized avatar
🇺🇦

Konstantin Lutovich lutovich

🇺🇦
View GitHub Profile
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@lutovich
lutovich / ArrayEqualityBenchmark.java
Created May 15, 2016 21:10
Measures performance of spevialized vs reflection based array equality check
package org.neo4j.testing.array_equality;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
@lutovich
lutovich / Person.java
Created February 4, 2016 08:31
Simple Neo4j Procedure to create/remove/list persons
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Stream;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.procedure.Context;
import org.neo4j.procedure.Procedure;
import static org.neo4j.graphdb.Label.label;
@lutovich
lutovich / MetaProcedures.java
Created February 4, 2016 08:30
Neo4j Procedure able to create/execute/drop other procedures from specified JAR files
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;