Skip to content

Instantly share code, notes, and snippets.

View lnramirez's full-sized avatar

Luis Ramirez Monterosa lnramirez

View GitHub Profile
//ommited code
def receive = {
case aMessage =>
val aFuture = future(db.getConnection)
aFuture.map { theConn => //from previous line when you acquire the conn and when you execute the next line
//it could pass a long time they run in different threads/time
//that's why you should better create an actor that handles this sync and let
//akka do the async part
theConn.prepareStatemnt(someSQL)
####################################
# Akka Actor Reference Config File #
####################################
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.
akka {
# Akka version, checked against the runtime version of Akka.
version = "2.4-SNAPSHOT"
@Grab('com.itextpdf:itextpdf:5.3.4')
@GrabConfig(systemClassLoader = true)
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import com.itextpdf.text.pdf.PdfRectangle;
public interface UselessService
{
public int blah();
}
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
package bajoneando
trait Position
object Left extends Position
object Right extends Position
class Node[T](parent : Node[T], value : T) {
{
"dojoBuild": "lnramirez.profile.js"
}
if (confirm("Are you sure you want to delete this image?")) {
require(["dojo/json","dojo/request/xhr","dojo/query","dojo/dom-construct"],
function(json,xhr,query,domConstruct) {
xhr.del("${pageContext.request.contextPath}/images/delete/" + id_,{headers: {"Content-Type": "application/json"}}).
then(function(response) {
var node = query("div#" + id_)[0];
if (node != 'undefined') {
node.parentNode.removeChild(node);
}
});