Skip to content

Instantly share code, notes, and snippets.

View cescoffier's full-sized avatar
⚗️
Quarking...

Clement Escoffier cescoffier

⚗️
Quarking...
View GitHub Profile
package io.vertx.ext.amqp;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
apiVersion: "istio.openshift.com/v1alpha1"
kind: "Installation"
metadata:
name: "istio-installation"
spec:
deployment_type: origin
istio:
authentication: true
community: false
version: 0.2.0
#!/bin/bash
#!/bin/bash
set -e
RED='\033[0;31m'
NC='\033[0m' # No Color
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
if ((`git status -sb | wc -l` != 1)); then
@cescoffier
cescoffier / CollectionCodecs.java
Created December 7, 2017 14:37
Example how to use Collection Codec with Vert.x Web Client
package com.example.demo;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.codec.BodyCodec;
import io.vertx.ext.web.codec.impl.BodyCodecImpl;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
#!/usr/bin/env bash
PROJECT=$(./oc project -q)
echo "Cleaning up current project: ${PROJECT}"
# https://docs.openshift.org/latest/cli_reference/basic_cli_operations.html#object-types
./oc delete build --all
./oc delete bc --all
./oc delete dc --all
./oc delete deploy --all
package me.escoffier.misc;
import java.util.HashSet;
import java.util.Set;
/**
* Generates names.
*
* @author <a href="http://escoffier.me">Clement Escoffier</a>
*/
@cescoffier
cescoffier / MyFirstVerticle.java
Created May 8, 2017 16:47
Example of verticle reconfiguration
package io.vertx.sample;
import io.vertx.config.ConfigRetrieverOptions;
import io.vertx.config.ConfigStoreOptions;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.json.JsonObject;
import io.vertx.rxjava.config.ConfigRetriever;
import io.vertx.rxjava.core.AbstractVerticle;
public class MyFirstVerticle extends AbstractVerticle {
@Override
public void start(Future<Void> fut) {
jdbcClient = JDBCClient.createShared(vertx, new JsonObject()
.put("url", "jdbc:mysql://localhost:3306/data")
.put("driver_class", "com.mysql.cj.jdbc.Driver")
.put("user", "user")
.put("password", "secret")
.put("max_pool_size", 30));
Json.prettyMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
#!/bin/bash
set -e
RED='\033[0;31m'
NC='\033[0m' # No Color
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
CURRENT_VERSION=`mvn help:evaluate -Dexpression=project.version | grep -e '^[^\[]'`
echo -e "${BLUE}CURRENT VERSION: ${YELLOW} ${CURRENT_VERSION} ${NC}"
ObjC.import('Cocoa');
ObjC.import('Foundation')
var args = $.NSProcessInfo.processInfo.arguments
var argv = []
var argc = args.count // -[NSArray count]
for (var i = 0; i < argc; i++) {
argv.push( ObjC.unwrap( args.objectAtIndex(i) ) ) // -[NSArray objectAtIndex:]