Skip to content

Instantly share code, notes, and snippets.

View angeliski's full-sized avatar

Rogerio Angeliski angeliski

View GitHub Profile
@angeliski
angeliski / protips.js
Created January 6, 2016 15:12 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
@angeliski
angeliski / CidLogicResult
Created July 20, 2014 15:59
LogiResult extension for strategy @ConversationScoped in vraptor4
import static br.com.caelum.vraptor.proxy.CDIProxies.unproxifyIfPossible;
import static com.google.common.base.Preconditions.checkArgument;
import java.io.IOException;
import java.lang.reflect.Method;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;