Install the OpenSSL on Debian based systems
sudo apt-get install openssl
/* | |
* Copyright 2016 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright 2016 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
// A couple of inlined utility functions: the first is just a syntax convenience, the second lets us use | |
// Kotlin's string interpolation efficiently: the message is never calculated/concatenated together unless | |
// logging at that level is enabled. | |
inline fun <reified T : Any> loggerFor(): org.slf4j.Logger = LoggerFactory.getLogger(T::class.java) | |
inline fun org.slf4j.Logger.trace(msg: () -> String) { | |
if (isTraceEnabled) trace(msg()) | |
} | |
/** | |
* A Java logging formatter that writes more compact output than the default. |
import okhttp3.Call; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.Response; | |
import okhttp3.mockwebserver.MockResponse; | |
import okhttp3.mockwebserver.MockWebServer; | |
import okhttp3.mockwebserver.RecordedRequest; | |
import org.junit.Rule; | |
import org.junit.Test; |
import java.lang.instrument.*; | |
import java.security.ProtectionDomain; | |
public class GetBytecode implements ClassFileTransformer { | |
private static Instrumentation inst; | |
public static synchronized void agentmain(String args, Instrumentation inst) { | |
GetBytecode.inst = inst; | |
} |
/* | |
* Copyright (C) 2016 Jeff Gilfelt. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the essence of the transformation in terms of an individual element. Because transducers are decoupled from input or output sources, they can be used in many different processes - collections, streams, channels, observables, etc. Transducers compose directly, without awareness of input or creation of intermediate aggregates.
Transducers.kt
: https://gist.github.com/Spasi/4052e4e8c8d88a7325fbTransducersTest.kt
: https://gist.github.com/Spasi/2a9d7d420b20f37513d5All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent