๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.http.codec.ServerSentEvent; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import reactor.core.publisher.Flux; | |
import reactor.util.function.Tuples; | |
import java.time.Duration; | |
import java.util.concurrent.ThreadLocalRandom; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id:0 | |
event:random | |
data:751025203 | |
id:1 | |
event:random | |
data:-1591883873 | |
id:2 | |
event:random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package calculator | |
expect fun log(msg: String) | |
object Calculator { | |
fun add(x: Int, y: Int): Int { | |
log("add -> $x $y") | |
return x + y | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package calculator | |
actual fun log(msg: String) = System.out.println(msg) | |
fun main(args: Array<String>) { | |
Calculator.add(1, 2) | |
Calculator.subtract(1, 2) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package calculator | |
actual fun log(msg: String) = console.log(msg) | |
fun main(args: Array<String>) { | |
Calculator.add(1, 2) | |
Calculator.subtract(1, 2) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keytool -keystore mykey.jks -alias mykey -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -genkey -validity 3650 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Server server = new Server(); | |
final HttpConfiguration httpConfiguration = new HttpConfiguration(); | |
httpConfiguration.setSecureScheme("https"); | |
httpConfiguration.setSecurePort(httpsPort); | |
final ServerConnector http = new ServerConnector(server, | |
new HttpConnectionFactory(httpConfiguration)); | |
http.setPort(httpPort); | |
server.addConnector(http); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final SslContextFactory sslContextFactory = new SslContextFactory(keyStorePath); | |
sslContextFactory.setKeyStorePassword(keyStorePassword); | |
final HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); | |
httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); | |
final ServerConnector httpsConnector = new ServerConnector(server, | |
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), | |
new HttpConnectionFactory(httpsConfiguration)); | |
httpsConnector.setPort(httpsPort); | |
server.addConnector(httpsConnector); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -cp jetty-util-9.2.17.v20160517.jar org.eclipse.jetty.util.security.Password password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM williamyeh/ansible:ubuntu16.04 | |
RUN pip install --upgrade pip && \ | |
pip install boto3 && \ | |
pip install boto | |
ADD ansible /etc/ansible | |
RUN chmod +x /etc/ansible/ec2.py |