Skip to content

Instantly share code, notes, and snippets.

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

Clement Escoffier cescoffier

⚗️
Quarking...
View GitHub Profile
docker run -t -i -p 8080:8080 sample/vertx-ruby
Thread Thread[vert.x-eventloop-thread-2,5,main] has been blocked for 2092 ms, time limit is 2000
Thread Thread[vert.x-eventloop-thread-2,5,main] has been blocked for 3148 ms, time limit is 2000
Thread Thread[vert.x-eventloop-thread-2,5,main] has been blocked for 4148 ms, time limit is 2000
Thread Thread[vert.x-eventloop-thread-2,5,main] has been blocked for 5148 ms, time limit is 2000
io.vertx.core.VertxException: Thread blocked
at com.kenai.jffi.MemoryIO.verifyAccessor(MemoryIO.java:1004)
at com.kenai.jffi.MemoryIO.isUnsafeAvailable(MemoryIO.java:1028)
at com.kenai.jffi.MemoryIO.newMemoryIO(MemoryIO.java:86)
at com.kenai.jffi.MemoryIO.access$000(MemoryIO.java:41)
@cescoffier
cescoffier / gist:fabe23ac3f2a0bc1a164
Created June 23, 2015 13:49
angular realtime (JS) stack trace
Unhandled exception
java.lang.RuntimeException: java.lang.NoSuchMethodException: Can't unambiguously select between fixed arity signatures [(java.util.Map), (java.lang.String)] of the method io.vertx.core.json.JsonObject.<init> for argument types [jdk.nashorn.internal.runtime.Undefined]
at jdk.nashorn.internal.runtime.arrays.IteratorAction.apply(IteratorAction.java:116)
at jdk.nashorn.internal.objects.NativeArray.forEach(NativeArray.java:1607)
at jdk.nashorn.internal.scripts.Script$Recompilation$182$1566AA$\^eval\_#88\!17\^eval\_.L:1$loadData$L:47(server.js:83)
at jdk.nashorn.internal.scripts.Script$Recompilation$176$19479A$\^eval\_#88\!17\^eval\_.L:1$MongoClient$dropCollection$L:471(vertx-mongo-js/mongo_client.js:473)
at io.vertx.core.Handler$$NashornJavaAdapter.handle(Unknown Source)
at io.vertx.ext.mongo.impl.MongoClientImpl.lambda$null$33(MongoClientImpl.java:324)
at io.vertx.ext.mongo.impl.MongoClientImpl$$Lambda$12/463812514.handle(Unknown Source)
## worker - ruby
* Status: FAILURE
* Execution time: 7128 ms
* Run File: /Users/clement/Projects/vert.x/vertx-integration-tests/vertx-examples-it/target/it/core-examples/core-worker-run.json
### Run and Execution
@cescoffier
cescoffier / git-cleanup.fish
Created August 18, 2015 06:58
A function deleting all git branches that have been merged into the current branch
function cleanup-branches
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
end
@cescoffier
cescoffier / gist:641920
Created October 23, 2010 08:02
iPOJO Inheritence
public class Parent {
@Requires
LogService log;
public void doSomething() {
log.log();
}
}
public class Child extends Parent {
//...
@cescoffier
cescoffier / gist:1303334
Created October 21, 2011 08:04
Play + MongoDB + Java deployment with puppet
notice: Scope(Class[Play]): Installing Play 1.2.3
notice: Scope(Play::Module[mongodb module]): Installing module mongo-1.3
notice: Scope(Play::Module[less module]): Installing module less-0.3
notice: /Stage[main]/Play/Exec[download-play-framework]/returns: executed successfully
notice: /Stage[main]/Play/Package[unzip]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Play/Exec[unzip-play-framework]/returns: executed successfully
notice: /Stage[main]/Play/File[/opt/play-1.2.3/play]/mode: mode changed '777' to '755'
notice: /Stage[main]//Play::Module[less module]/Exec[install-play-module-less-0.3]/returns: executed successfully
notice: /Stage[main]/Mongodb/Package[python-software-properties]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Mongodb/Exec[10gen-apt-repo]/returns: executed successfully
@cescoffier
cescoffier / script
Created January 23, 2012 16:39
Update Jabber server in Jenkins builds.When switching to another Jabber server, builds needs to be updated to use the new Jabber server, i.e. xxx@server1.de needs to become xxx@server2.de.This groovy script just updates the configuration.
import hudson.model.*
import hudson.maven.*
import hudson.maven.reporters.*
import hudson.tasks.*
def instance = hudson.model.Hudson.instance;
// To update to match the old server and new configuration
def oldServer = "akquinet.dnsalias.com";
def newServer = "chat.spree.de";
private void generateMethodHeader(int access, String name, String desc, String signature, String[] exceptions, List<AnnotationDescriptor> annotations, Map<Integer, List<AnnotationDescriptor>> paramAnnotations) {
GeneratorAdapter mv = new GeneratorAdapter(cv.visitMethod(access, name, desc, signature, exceptions), access, name, desc);
mv.visitCode();
Type returnType = Type.getReturnType(desc);
// Compute result and exception stack location
// We also compute the actual Thread stack, when it requires the returned object.
generateMethodHeader
@cescoffier
cescoffier / PlentyOfAnnotations.java
Created April 17, 2012 15:08
Unit Test reproducing FELIX-3461
package test;
import org.apache.felix.ipojo.annotations.*;
import test.ipojo.ExternalHandler;
import java.util.List;
@Component
@Instantiate
public class PlentyOfAnnotations {