Skip to content

Instantly share code, notes, and snippets.

View ThomasVitale's full-sized avatar
🍃
Cloud Native Spring in Action

Thomas Vitale ThomasVitale

🍃
Cloud Native Spring in Action
View GitHub Profile
@ThomasVitale
ThomasVitale / .gdbinit
Created March 2, 2017 18:15
GDB Command File
set startup-with-shell off
@ThomasVitale
ThomasVitale / functions.php
Last active February 15, 2018 16:22
Function to customise the title of WordPress archive pages
<?php
function thomas_archive_title( $title ) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = '<span class="vcard">' . get_the_author() . '</span>';
} elseif ( is_post_type_archive() ) {
@ThomasVitale
ThomasVitale / Application.java
Created April 17, 2018 19:29
Spring Data MongoDB using Java Configuration
package com.thomasvitale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.thomasvitale.model.Person;
import com.thomasvitale.repository.PersonRepository;
package com.thomasvitale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.thomasvitale.model.Person;
import com.thomasvitale.repository.PersonRepository;
@ThomasVitale
ThomasVitale / Application.java
Last active September 30, 2018 18:04
Spring Data JPA - Basic Configuration
package com.thomasvitale.jpa.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
@ThomasVitale
ThomasVitale / ThreadTest.java
Last active March 1, 2020 21:16
Multitenancy Stuff
package com.thomasvitale.application;
import com.thomasvitale.application.multitenancy.TenantContext;
import org.junit.jupiter.api.Test;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ThreadTest {
@ThomasVitale
ThomasVitale / ConnectorConfig.java
Last active November 17, 2020 14:25
How to enable HTTPS in a Spring Boot Application
@Configuration
public class ConnectorConfig {
@Bean
public EmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
@Override
protected void postProcessContext(Context context) {
SecurityConstraint securityConstraint = new SecurityConstraint();
securityConstraint.setUserConstraint("CONFIDENTIAL");
@ThomasVitale
ThomasVitale / custom-values.yml
Last active March 2, 2023 16:45
Carvel ytt - Example with empty ConfigMap
#@data/values
---
config-features:
secure-pod-defaults: "enabled"
@ThomasVitale
ThomasVitale / custom-values.yml
Last active March 2, 2023 20:12
Contour ConfigMap Example with Carvel ytt
#@data/values
---
config-contour:
timeouts:
connection-idle-timeout: 30s
stream-idle-timeout: 2m
disablePermitInsecure: true
# Imgpkg => https://carvel.dev/imgpkg
imgpkg copy \
-i docker.io/thomasvitale/book-service:1.0 \
--to-repo ghcr.io/thomasvitale/book-service \
--cosign-signatures
# Skopeo => https://github.com/containers/skopeo
skopeo copy \
docker://docker.io/thomasvitale/book-service:1.0 \
docker://quay.io/thomasvitale/book-service:1.0