This file contains 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
// after viper read config, replace all placeholders with values | |
func ReplacePlaceHolders() { | |
r, _ := regexp.Compile("\\${[a-zA-Z0-9.: _]+}") | |
replacer := func(placeHolder []byte) []byte { | |
name := string(placeHolder) | |
name = name[2 : len(name)-1] | |
index := strings.Index(name, ":") | |
if index != -1 { | |
defaultValue := name[index+1:] |
This file contains 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
//usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 21 | |
//DEPS org.junit.jupiter:junit-jupiter-engine:5.10.1 | |
//DEPS org.junit.platform:junit-platform-console:1.9.3 | |
//DEPS org.assertj:assertj-core:3.25.1 | |
package com.example; | |
import org.junit.jupiter.api.Test; | |
import org.junit.platform.console.options.CommandLineOptions; |
This file contains 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 linuxchina/jbang-action as builder | |
ARG mainClass="Hello2.java" | |
RUN mkdir -p /opt/app/out | |
WORKDIR /opt/app | |
COPY $mainClass /opt/app | |
RUN jbang export portable -O out/app.jar $mainClass |
This file contains 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 linuxchina/jbang-action:0.94.0-graal-java17-22.1.0 as builder | |
ARG mainClass="Hello2.java" | |
RUN mkdir -p /opt/app/out | |
WORKDIR /opt/app | |
COPY $mainClass /opt/app | |
RUN jbang export portable --native -O out/main $mainClass |
This file contains 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 jdk.jfr.consumer.RecordingStream; | |
import org.springframework.messaging.handler.annotation.MessageMapping; | |
import org.springframework.stereotype.Controller; | |
import reactor.core.publisher.Flux; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.time.temporal.ChronoUnit; | |
@Controller |
This file contains 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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "JBang catalogs JSON Schema", | |
"description": "JSON Schema for jbang-catalog.json", | |
"type": "object", | |
"properties": { | |
"aliases": { | |
"description": "aliases", | |
"type": "object", | |
"additionalProperties": { |
This file contains 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
#!/usr/bin/env bash | |
# https://medium.com/codex/a-bash-template-cheat-sheet-is-very-useful-f8207b442e78 | |
set -Eeuo pipefail | |
# Define variables | |
readonly dir="$(dirname "$0")" | |
# Usage or Help message | |
usage() { |
This file contains 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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.5.Final:linux-x86_64 | |
import io.netty.incubator.channel.uring.IOUring; | |
public class HelloIoUring { | |
public static void main(String[] args) { | |
IOUring.ensureAvailability(); | |
System.out.println("Hello io_uring!"); | |
} |
This file contains 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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: GraalVM Native Image build | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '*' ] |
This file contains 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] | |
name = "multipass" | |
version = "0.1.0" | |
authors = ["linux_china <libing.chen@gmail.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
clap = { version = "3.0.0-beta.2", features = ["yaml"] } |
NewerOlder