Skip to content

Instantly share code, notes, and snippets.

@gonzalad
gonzalad / head-api.yaml
Created April 27, 2021 12:43
[BUG] Invalid @HeadMapping annotation generated in Spring controller
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
@gonzalad
gonzalad / kubernetes_commands.md
Created January 28, 2020 22:00 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@gonzalad
gonzalad / PropertyLogger.java
Created November 5, 2019 21:41 — forked from sandor-nemeth/PropertyLogger.java
Spring Boot - Log all configuration properties on application startup
package de.idealo.ecommerce.order.history.config;
import java.util.Arrays;
import java.util.stream.StreamSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.AbstractEnvironment;
@gonzalad
gonzalad / Jenkinsfile
Created January 3, 2019 20:08 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
openapi: 3.0.0
info:
description: Api Documentation
version: '1.0'
title: Api Documentation
termsOfService: 'urn:tos'
contact: {}
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0'
public class ProjectController {
private List<ProjectResource> projectResources = Arrays.asList(new ProjectResource("myProject1"), new ProjectResource("myProject2"));
@PreAuthorize("#oauth2.hasScope('urn:talend:project:read')")
@RequestMapping(method = RequestMethod.GET)
public List<ProjectResource> findAllProjects(Authentication authentication) {
// get projects from repository
List<ProjectResource> projectResources = this.projectResources;
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
@gonzalad
gonzalad / newformat.txt
Last active August 17, 2016 14:17
Java code formatting for DSL
package org.xxxx.iam.bla.converters;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
input {
file {
path => "/var/log/apache2/other_vhosts_access.log"
type => "apache"
start_position => beginning
ignore_older => 0
#sincedb_path => "/dev/null"
}
file {
path => "/home/agonzalez/git-projects/platform-services/sandbox/agonzalez-app/data-service/data-service.json.log"
@gonzalad
gonzalad / gist:3136863
Created July 18, 2012 15:22
NullPointerException on inputNumberSpinner RF 4.3.0-SNAPSHOT
```
<rich:inputNumberSpinner value="50">
```
Throws
```
17:13:56,046 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/aws-web].[Faces Servlet]] (http--0.0.0.0-8080-4) "Servlet.service()" pour la servlet Faces Servlet a généré une exception: java.lang.NullPointerException
at org.richfaces.renderkit.html.InputNumberSpinnerRenderer.convertToBoolean(InputNumberSpinnerRenderer.java:138) [richfaces-components-ui-4.3.0-20120704.042959-78.jar:4.3.0-SNAPSHOT]
at org.richfaces.renderkit.html.InputNumberSpinnerRenderer.doEncodeEnd(InputNumberSpinnerRenderer.java:175) [richfaces-components-ui-4.3.0-20120704.042959-78.jar:4.3.0-SNAPSHOT]