Skip to content

Instantly share code, notes, and snippets.

Rafael Pestano rmpestano

View GitHub Profile
@rmpestano
rmpestano / text.md
Last active Apr 9, 2020
Skip method handles
View text.md
  • 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 Dec 12, 2019
CDI bean selection
View bean-select.adoc

First I have 3 producers:

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

    @Produces
View gist:bedddf1c2b6b27588ab32c10f043f8c9
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 Jul 18, 2019
Cleans jenkins job workspace via groovy script
View cleanWS.md

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
  } 
View gist:447132f6cc197babeae284dfce8fc6e3
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
View registeredFactoryNames.adoc

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 Jun 21, 2019
Quarkus native build and execution log output
View out.adoc
[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 Apr 23, 2019
Java maven jenkinsfile
View Jenkinsfile.adoc
pipeline {
    agent any
    tools {
        maven 'apache-maven-3.3.9'
        jdk 'jdk1.8'
    }
    stages {
        stage('Build') {
            steps {
View remove accents.adoc
private String removeAccents(String str) {
        return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
    }
View gist:8ca08cc5c99c0016fe1bb330e461d6b7
kubectl patch deployment cdi-crud -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
You can’t perform that action at this time.