Skip to content

Instantly share code, notes, and snippets.

View rodolfodpk's full-sized avatar
🏠
Working from home

rodolfodpk rodolfodpk

🏠
Working from home
View GitHub Profile
@rodolfodpk
rodolfodpk / VertxModule.java
Created November 3, 2020 06:36
Converting and exporting a Quarkus config to Vertx JsonObject config
public class VertxModule {
@Produces
@ApplicationScoped
JsonObject config() {
String profile = ProfileManager.getActiveProfile().toLowerCase();
JsonObject vertxConfig = new JsonObject();
Config config = ConfigProvider.getConfig();
StreamSupport.stream(config.getConfigSources().spliterator(), false)
.filter(cs -> cs.getName().contains("application.properties"))
;;; based on the discussion at https://groups.google.com/d/msg/netty/mcGswAZ5NeQ/ivG9snRSFy4J
(ns netty4.core
(:import [io.netty.bootstrap AbstractBootstrap ServerBootstrap]
[io.netty.channel ChannelFuture ChannelInitializer ChannelOption
ChannelHandlerContext ChannelInboundHandlerAdapter ChannelHandler]
[io.netty.handler.logging LogLevel LoggingHandler]
io.netty.buffer.ByteBuf
io.netty.channel.socket.SocketChannel
io.netty.channel.nio.NioEventLoopGroup
// lib to add: http://code.google.com/p/google-gson/downloads/detail?name=google-gson-2.2.2-release.zip&can=2&q=
// file Main.scala
package demo
import scala.collection.JavaConverters._
import com.google.gson.Gson
import java.util.ArrayList
import java.lang.reflect.Type
import com.google.gson.reflect.TypeToken

Kotlin + Guiceやってみた

これは Kotlin Advent Calendar の26……じゃなくて13日目です!

経緯

がんばって読んでください。読まなくても良いですけど。

@rodolfodpk
rodolfodpk / gist:7a7ce63ff4f119d153aa
Created June 26, 2014 06:37
Hz QueueStore receiving duplicates keys for distinct messages
package com.woo
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.client.config.ClientNetworkConfig;
import com.hazelcast.config.*;
import com.hazelcast.core.*;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
apply plugin: "osgi"
apply plugin: "java"
apply plugin: "maven"
version = "0.0.1"
buildscript {
repositories {
mavenCentral()
}
@rodolfodpk
rodolfodpk / execOnChange.sh
Created September 4, 2012 17:13 — forked from derekwyatt/execOnChange.sh
Executes an arbitrary command when files change.
#!/bin/bash
command="$1"
shift
fileSpec="$@"
sentinel=/tmp/t.$$
touch -t197001010000 $sentinel
while :
do
@rodolfodpk
rodolfodpk / RenameSnapshot.java
Created August 30, 2012 13:38
Script para renomear jars de releases snapshots baixados do Artifactory
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
/**
* Script para renomear jars de releases snapshots baixados do Artifactory
* Possibilita time de QA rodar versão snapshot instalada da seguinte maneira
* java -jar instalador.jar -repo http://50.56.88.164:8080/artifactory/repo
* -snapshot os jars instalados vem com um timestamp adicionado ao nome e isto
* impossibilita a execução pois os MANIFESF.MF referenciam jars no formato
@rodolfodpk
rodolfodpk / CQRS_ES_Actor.scala
Created August 27, 2012 03:31 — forked from viktorklang/CQRS_ES_Actor.scala
CQRS and EventSourcing using Akka Actors
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {