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
complete -c multipass -n "__fish_use_subcommand" -s h -l help -d 'Prints help information' | |
complete -c multipass -n "__fish_use_subcommand" -s V -l version -d 'Prints version information' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "delete" -d 'Delete instances' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "exec" -d 'Run a command on an instance' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "find" -d 'Display available images to create instances from' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "get" -d 'Get a configuration setting' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "help" -d 'Display help about a command' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "info" -d 'Display information about instances' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "launch" -d 'Create and start an Ubuntu instance' | |
complete -c multipass -n "__fish_use_subcommand" -f -a "list" -d 'List all available instances' |
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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "Envoy Proxy config schema", | |
"description": "JSON Schema for Envoy Proxy config", | |
"type": "object", | |
"properties": { | |
"admin": { | |
"type": "object", | |
"description": "Configuration for the local administration HTTP server", | |
"properties": { |
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
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
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
import java.nio.charset.StandardCharsets; | |
import java.security.MessageDigest; | |
import java.util.List; | |
import java.util.SortedMap; | |
import java.util.TreeMap; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
public class KetamaConsistentHash<T> { |
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": { |
NewerOlder