Skip to content

Instantly share code, notes, and snippets.

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

Paulo Lopes pmlopes

🏠
Working from home
View GitHub Profile
@pmlopes
pmlopes / JsonArray.java
Created May 1, 2014 08:00
Suggested Json API for Vert.x 3.x
public class JsonArray extends ArrayList<Object> implements JsonElement<Integer>, List<Object> {
private static final long serialVersionUID = 1l;
public JsonArray() {
super();
}
public JsonArray(List<?> list) {
super(list);
@pmlopes
pmlopes / DB405A41.asc
Last active August 29, 2015 14:06
DB405A41.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
mQINBFQib6sBEACu3OvNg5z1U8FCJF/IJnPeNEz7yYXFeKhmjXmdBUPkXOiFuKRC
jlJWFZhnaKXapK0dB3LXrAEbn8EmNBB6PuAKqSJ/3fW/bQgdrZPW39tlO8MvbRJf
Z/QdOovCa1t7rMgofeq1CQJKX1jS9mcnCSBChedI+cQWVZao/CIaGC4uek4CXnZp
XaIeb2YaaHkhq18g8MSVR9YTBt1AgNUTsFczVHA8+RZ60GL0nqps/s0FH9QJDyf9
9OWXbOeJifbg03ul+Tx5kr0djouYKHOJypF8kM+HPpiBbcsskXpbAmv+OI0eu/AC
FJxf/7LtBMD6czPrx6/3HSisWxqgPfh3N8K896lmgH4aORQ1sAVj0ipimlYhIskl
gfKFSdYj1HsmbzqoK+W8ga345arX5q/rpgTGYOznjBbS1vbGOyhR8TVGHugnsSXf

Keybase proof

I hereby claim:

  • I am pmlopes on github.
  • I am pmlopes (https://keybase.io/pmlopes) on keybase.
  • I have a public key whose fingerprint is 349E 08C1 8265 2E9E 4CFD 9034 65E8 59E4 DB40 5A41

To claim this, I am signing this object:

@pmlopes
pmlopes / HelloSpec.groovy
Created June 23, 2015 09:37
Spock and Vertx3
import io.vertx.core.Vertx
import spock.lang.Shared
import spock.lang.Specification
import spock.util.concurrent.BlockingVariable
class HelloSpockSpec extends Specification {
@Shared
def Vertx vertx = Vertx.vertx()
@Test
public void testLoad() {
final AtomicInteger counter = new AtomicInteger();
int repetitions = 10000;
counter.set(repetitions);
for (int i = 0; i < repetitions; i++) {
redis.get("unknown", res -> {
if (res.failed()) {
@pmlopes
pmlopes / gist:755c775c03b152e1ca6f
Created July 1, 2015 15:01
base user system unit
[Unit]
Description=Vert.x Service
Wants=environment.target
[Service]
Type=simple
ExecStart=/bin/java $JAVA_OPTS -jar %h/rpi-1.0-fat.jar
[Install]
Alias=default.target
@pmlopes
pmlopes / PSQLVerticle.java
Last active December 25, 2019 02:38
Using PostgreSQL JSON with Vert.x3
package io.vertx.blog;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.jdbc.JDBCClient;
import io.vertx.ext.sql.SQLConnection;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.BodyHandler;
@pmlopes
pmlopes / package.json
Created July 10, 2015 14:08
vert.x3 for javascript developers
{
"name": "vertx3-hello",
"private": true,
"dependencies": {
"vertx3-min": "3.0.0-1"
},
"scripts": {
"start": "./node_modules/.bin/vertx run server.js"
}
}
@pmlopes
pmlopes / README.md
Created July 10, 2015 14:20
package vert.x stacks for npm

Vert.x 3 Minimal stack

Vert.x3 + the endorsed modules

Contents

  • Vert.x Core
  • Groovy, JS and Ruby languages
  • Hazelcast clustering
  • Service proxy
@pmlopes
pmlopes / settings.xml
Created September 10, 2015 08:33
Use sonatype snapshots in your local maven
<settings>
<profiles>
<profile>
<id>allow-snapshots</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>