Skip to content

Instantly share code, notes, and snippets.

View rmpestano's full-sized avatar

Rafael Pestano rmpestano

View GitHub Profile
@rmpestano
rmpestano / text.md
Last active April 9, 2020 12:47
Skip method handles
  • quarkus: 1.3.2
  • graalvm: 20.0.0
  • jdk11:
    @BuildStep
    void registerRuntimeInitialization(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitClassBuildItem)
    {
        runtimeInitClassBuildItem.produce(
                new RuntimeInitializedClassBuildItem(MethodHandleBeanELResolver.class.getCanonicalName()));
@rmpestano
rmpestano / bean-select.adoc
Last active December 12, 2019 13:12
CDI bean selection

First I have 3 producers:

    @Produces
    public EntityManager produce() {
        return EntityManagerProvider.instance("cdipu").em();
    }

    @Produces
@rmpestano
rmpestano / gist:bedddf1c2b6b27588ab32c10f043f8c9
Created October 19, 2019 13:35
TODO list on the Netherlads
Arrive safe
Don't get fired
Find permanent house and place to live (from 2nd month)
Find a nice school for the kids
Survive first winter
Play soccer (preferable against Argentines)
Make Caipirinha
Make a barbecue using barbecue skewers
Find "Erva mate" and drink "chimarrão"
Visit Brazil on Chrismass 2020 (run away from the winter)
@rmpestano
rmpestano / cleanWS.md
Last active July 18, 2019 11:13
Cleans jenkins job workspace via groovy script

Script below must be executed in jenkinsURL/script by an admin user

Job item = Jenkins.instance.getItemByFullName("JOB_NAME")
          
for (Node node in Jenkins.instance.nodes) {
  // Make sure slave is online
  if (!node.toComputer().online) {
    continue
 } 
2019-06-24 18:53:07,191 localhost quarkus-myfaces-showcase-1.0-SNAPSHOT-runner[18596] INFO [io.quarkus] (main) Quarkus 0.17.0 started in 0.006s. Listening on: http://0.0.0.0:8080
2019-06-24 18:53:07,191 localhost quarkus-myfaces-showcase-1.0-SNAPSHOT-runner[18596] INFO [io.quarkus] (main) Installed features: [cdi, myfaces, undertow-websockets]
2019-06-24 18:53:11,790 localhost quarkus-myfaces-showcase-1.0-SNAPSHOT-runner[18596] INFO [jav.fac.FactoryFinder] (executor-thread-1) getClassLoader - 2
2019-06-24 18:53:11,790 localhost quarkus-myfaces-showcase-1.0-SNAPSHOT-runner[18596] INFO [jav.fac.FactoryFinder] (executor-thread-1) registeredFactoryNames: {java.lang.ClassLoader@2d1df30={javax.faces.context.ExternalContextFactory=[org.apache.myfaces.context.ExternalContextFactoryImpl], javax.faces.context.PartialViewContextFactory=[org.apache.myfaces.context.PartialViewContextFactoryImpl, org.primefaces.context.PrimePartialViewContextFactory], javax.faces.flow.FlowHandlerFactory=[org.apache.myfaces.flow.FlowHan

12:59:28,237 INFO [jav.fac.FactoryFinder] registeredFactoryNames: {com.oracle.svm.hosted.NativeImageClassLoader@71086f27={javax.faces.context.ExternalContextFactory=[org.apache.myfaces.context.ExternalContextFactoryImpl], javax.faces.context.PartialViewContextFactory=[org.apache.myfaces.context.PartialViewContextFactoryImpl, org.primefaces.context.PrimePartialViewContextFactory], javax.faces.flow.FlowHandlerFactory=[org.apache.myfaces.flow.FlowHandlerFactoryImpl], javax.faces.render.RenderKitFactory=[org.apache.myfaces.renderkit.RenderKitFactoryImpl], javax.faces.view.ViewDeclarationLanguageFactory=[org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl], javax.faces.context.FlashFactory=[org.apache.myfaces.context.servlet.ServletFlashFactoryImpl], javax.faces.context.FacesContextFactory=[org.apache.myfaces.context.FacesContextFactoryImpl, org.primefaces.context.PrimeFacesContextFactory], javax.faces.component.visit.VisitContextFactory=[org.apache.myfaces.component.visit.VisitContextFactoryImpl], javax.f

@rmpestano
rmpestano / out.adoc
Last active June 21, 2019 20:26
Quarkus native build and execution log output
[INFO] [io.quarkus.creator.phase.nativeimage.NativeImagePhase] Running Quarkus native-image plugin on OpenJDK 64-Bit Server VM
[INFO] [io.quarkus.creator.phase.nativeimage.NativeImagePhase] docker run -v /home/rafael-pestano/projetos/quarkus-myfaces-native/quarkus-myfaces/quarkus-myfaces-showcase/target:/project:z --rm --user 74086768:560800513 quay.io/quarkus/centos-quarkus-native-image:graalvm-1.0.0-rc16 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar quarkus-myfaces-showcase-1.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:+PrintAnalysisCallTree -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-SpawnIsolates -H:-JNI --no-server -H:-UseServiceLoaderFeature -H:+StackTrace
WARNING: Error loading config file: /home/rafael-pestano/.docker/config.json: open /home/rafael-pestano/.docker/config.json: permission
@rmpestano
rmpestano / Jenkinsfile.adoc
Last active April 23, 2019 21:46
Java maven jenkinsfile
pipeline {
    agent any
    tools {
        maven 'apache-maven-3.3.9'
        jdk 'jdk1.8'
    }
    stages {
        stage('Build') {
            steps {
@rmpestano
rmpestano / remove accents.adoc
Created April 20, 2019 00:13
Remove accents
private String removeAccents(String str) {
        return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
    }
kubectl patch deployment cdi-crud -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"