Skip to content

Instantly share code, notes, and snippets.

View brunoborges's full-sized avatar
🏠
127.0.0.1

Bruno Borges brunoborges

🏠
127.0.0.1
View GitHub Profile
void main() {
IO.println("rock/paper/scissors:");
var u = IO.readln();
if (u.equals("exit")) return;
var c = "rock,paper,scissors".split(",");
var i = List.of(c).indexOf(u);
if (i < 0) return;
var j = new Random().nextInt(3);
IO.println("Computer: " + c[j]);
IO.println(i == j ? "Tie!" : (i == (j + 1) % 3 ? "You win!" : "Computer wins!"));
void main() {
var s = """
void main() {
var s = %c%c%c
%s%c%c%c;
IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34));
}""";
IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34));
}
#!/usr/bin/env bash
# check-jvm-env-precedence.sh
# Pairwise precedence test for: _JAVA_OPTIONS, JAVA_TOOL_OPTIONS, JDK_JAVA_OPTIONS
set -euo pipefail
say() { printf "%s\n" "$*"; }
hr() { printf "%s\n" "----------------------------------------"; }
# Tiny source-file program
[
{
"id": 389291,
"title": "Kotlin Multiplatform Conversions at Android Jetpack Scale",
"description": "This is a case study of how we converted several Jetpack libraries to Kotlin Multiplatform as part of our ongoing experimentation with the multiplatform technology."
},
{
"id": 405587,
"title": "Compose Multiplatform on iOS",
"description": "An overview of the exciting present and future of Compose Multiplatform, including live demos and how to get started with the latest additions to the multiplatform UI framework built by JetBrains."
@brunoborges
brunoborges / App.java
Created November 28, 2022 19:29
Issue #55 in microsoft/openjdk-docker repo
import java.lang.management.ManagementFactory;
public class App {
public static void main(String[] args) {
long currentTime = System.currentTimeMillis();
long startTime = ManagementFactory.getRuntimeMXBean().getStartTime();
System.out.println("JVM Startup time: " + (currentTime - startTime));
}
}
#!/bin/bash
set -x
function setenv-all-pods() {
echo
DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o jsonpath='{.items[*].metadata.name}')
echo "Set Log4J setting for all pods by overriding LOG4J_FORMAT_MSG_NO_LOOKUPS with true."
for deployment_name in $DEPLOYMENT_LIST; do
kubectl -n $1 set env deployment $deployment_name LOG4J_FORMAT_MSG_NO_LOOKUPS="true"
done
//DEPS org.openjfx:javafx-controls:11.0.2:${os.detected.jfxname}
//DEPS org.openjfx:javafx-graphics:11.0.2:${os.detected.jfxname}
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class hello extends Application {
dotnet_grpc_bench.report: Average: 1.32 ms
dotnet_grpc_bench.report- Requests/sec: 36510.82
dotnet_grpc_bench.report-
--
dotnet_grpc_bench.report: 90 % in 1.77 ms
dotnet_grpc_bench.report- 95 % in 2.10 ms
dotnet_grpc_bench.report- 99 % in 3.93 ms
--
go_grpc_bench.report: Average: 0.97 ms
go_grpc_bench.report- Requests/sec: 49283.43
@brunoborges
brunoborges / config.toml
Last active June 4, 2020 21:31
Proposal for a TOML Schema Definition
# [toml]
# version = 2
# schema = config.tosd
title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
public class ConsumeSingleton {
public ConsumeSingleton() {
HttpClient._.call(...);
HttpClient.get.call(...);
HttpClient.INSTANCE.call(...);
}
}