I hereby claim:
- I am fzakaria on github.
- I am fzakaria (https://keybase.io/fzakaria) on keybase.
- I have a public key whose fingerprint is 0D68 D1FD E13D EBD6 95B9 19B2 81FB F501 D1B2 32E7
To claim this, I am signing this object:
/** | |
* A very simple class that helps encode/decode for Ascii85 / base85 | |
* The version that is likely most similar that is implemented here would be the Adobe version. | |
* @see <a href="https://en.wikipedia.org/wiki/Ascii85">Ascii85</a> | |
*/ | |
public class Base85 { | |
private final static int ASCII_SHIFT = 33; |
package casper.verification.struct; | |
import net.sf.kdgcommons.buffer.BufferFacade; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
import java.nio.MappedByteBuffer; | |
import java.util.function.Function; | |
public class BigByteBuffer implements BufferFacade { |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.uber.jaeger.Span; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
/** | |
* Jackson mixin for defining how a {@link com.uber.jaeger.Span} gets turned into JSON | |
* This was built using the fixtures from Jaeger codebase -- | |
* The usefulness of this class would be if as part of your infrastructure there are already ways to get log data |
/** | |
* A very simple {@link Injector} and {@link Extractor} that use a {@link StringBuffer} as the transmission. | |
* This class <b>will only</b> transmit the {@link io.opentracing.SpanContext} without any baggage | |
* (that's why its simple). | |
*/ | |
public class SimpleStringCodec implements Injector<StringBuffer> , Extractor<StringBuffer> { | |
@Override | |
public void inject(SpanContext spanContext, StringBuffer carrier) { | |
carrier.append(spanContext.contextAsString()); |
import com.uber.jaeger.Span; | |
import com.uber.jaeger.Tracer; | |
import com.uber.jaeger.exceptions.SenderException; | |
import com.uber.jaeger.reporters.Reporter; | |
import com.uber.jaeger.samplers.ConstSampler; | |
import com.uber.jaeger.samplers.Sampler; | |
import com.uber.jaeger.senders.ThriftSender; | |
import com.uber.jaeger.thriftjava.Process; | |
import org.apache.thrift.TBase; | |
import org.apache.thrift.TException; |
/** | |
* Too many examples on the internet demonstrate using self-signed certificates by disabling hostname verification | |
or providing a weak TrustManager (i.e. SelfSignedTrustManager). | |
This example shows how to properly start a server & client in the same JVM where the client knows about the | |
generated self-signed certificate. | |
Also it's all done programmatically! Avoid using keytool and pulling in heavy dependencies like BouncyCastle!~ | |
**/ | |
public class SecureServerTest { | |
/** |
public class Test { | |
@Test | |
public void testExtractMasterkeyWorksCorrectly() throws Exception { | |
SelfSignedCertificate cert = new SelfSignedCertificate(); | |
SslContext serverContext = SslContextBuilder.forServer(cert.key(), cert.cert()) | |
.sslProvider(SslProvider.OPENSSL).build(); | |
final OpenSslEngine serverEngine = | |
(OpenSslEngine) serverContext.newEngine(UnpooledByteBufAllocator.DEFAULT); |
class TestTable < Sequel::Model(:test_table) | |
def is_something? | |
self[:x] == 123 | |
end | |
end | |
TestTable.where{ is_something? } |
I hereby claim:
To claim this, I am signing this object:
class RequestFilter | |
def initialize(app, tracer) | |
@app = app | |
@tracer = tracer | |
end | |
EXCLUDED_PATH_PREFIXES = %w[ | |
... | |
].freeze |