Instantly share code, notes, and snippets.

View Dockerfile
FROM debian:stretch
RUN apt-get update
RUN apt-get install --yes --no-install-recommends ca-certificates curl gpg
RUN echo "deb http://packages.cloud.google.com/apt gcsfuse-stretch main" | tee /etc/apt/sources.list.d/gcsfuse.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update
RUN apt-get install --yes gcsfuse
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
View ProtoColumnType.kt
// Protocol Buffer (protobuf) V3 - Kotlin Exposed columnType
// Converts to and from jsonb fields in postgres.
class ProtoColumnType(val message: Message) : ColumnType() {
override fun sqlType() = "JSONB"
override fun valueFromDB(value: Any): Any {
if (value is PGobject) {
return JsonFormat.parser().ignoringUnknownFields().merge(value.value, message.toBuilder())
}
throw RuntimeException("Can't parse object: ${value}")
View ChildFirstClassLoader.java
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
public class ChildFirstClassLoader extends URLClassLoader {