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 org.springframework.http.client; | |
import org.springframework.core.task.SimpleAsyncTaskExecutor; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.util.Assert; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.time.Duration; |
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 com.example.demo; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.ResponseBody; | |
import org.springframework.web.client.RestClient; | |
import java.util.Map; |
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
// I'd suggest you create an alias somewhere: | |
// alias uao=java --enable-preview --source 21 $HOME/bin/UAO.java | |
// RUN: uao $HOME/Downloads/demo.zip | |
import java.io.*; | |
import java.util.function.*; | |
import java.util.* ; | |
void main(String[] args) throws Exception { | |
var zipFile = new File(args[0]); |
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 com.example.demo; | |
import org.springframework.boot.ApplicationRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; |
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
@Configuration | |
class VcConfiguration { | |
@Bean | |
static ViewComponentResourceAotProcessor viewComponentResourceAotProcessor() { | |
return new ViewComponentResourceAotProcessor(); | |
} | |
} |
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 hollywood.framework; | |
import org.junit.jupiter.api.Assertions; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.core.io.Resource; | |
import org.springframework.core.io.ResourceLoader; | |
import org.springframework.core.io.support.ResourcePatternResolver; | |
import org.springframework.util.FileCopyUtils; |
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 | |
PID=${1} | |
RSS=`ps -o rss ${PID} | tail -n1` | |
RSS=`bc <<< "scale=1; ${RSS}/1024"` | |
echo "${PID}: ${RSS}M" |
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
// run with | |
// java DatesApplication.java | |
import java.time.LocalDate; | |
import java.time.temporal.ChronoUnit; | |
import java.util.Map; | |
public class DatesApplication { |
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
/* | |
add schema.sql | |
create table customer | |
( | |
id serial primary key, | |
name varchar(255) not null | |
); | |
add spring boot starters as usual, then add: | |
NewerOlder