Skip to content

Instantly share code, notes, and snippets.

View kinisoftware's full-sized avatar

Joaquin Engelmo Moriche kinisoftware

View GitHub Profile
import grails.test.*
class VisitaUnitTest extends GrailsUnitTestCase {
protected void setUp() {
super.setUp();
}
protected void tearDown() {
super.tearDown();
<entidad>
<persona>
<nombre>Paco</nombre>
<apellidos>Garcia Garcia</apellidos>
<edad>19</edad>
<direccion>
<calle>mi calle</calle>
<numero>28</numero>
<cp>10001</cp>
<localidad>Caceres</localidad>
{"persona":
{"nombre":"paco","apellidos":"garcia garcia", "edad":"19",
"direccion":
{"calle":"mi calle", "numero":"28", "cp":"10001", "localidad":"Caceres"}
}
}
@kinisoftware
kinisoftware / about.md
Created August 16, 2011 16:34 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@kinisoftware
kinisoftware / gist:5282103
Created March 31, 2013 21:38
Curso MongoDB Java - 10Gen - Week5 - HW5.2
db.zips.aggregate([{$match:{$or:[{state:"CA"}, {state:"NY"}]}}, {$group:{_id:{state:"$state", city:"$city"}, total_pop:{$sum:"$pop"}}}, {$match:{total_pop:{$gt:25000}}}, {$group:{_id:null, avg_pop:{$avg:"$total_pop"}}}])
@kinisoftware
kinisoftware / gist:5282233
Created March 31, 2013 22:18
Curso MongoDB Java - Week5 - HW5-3
db.grades.aggregate([{$unwind:"$scores"}, {$match:{$or:[{"scores.type":"homework"}, {"scores.type":"exam"}]}}, {$group:{_id:{student_id:"$student_id", class_id:"$class_id"}, avg_score:{$avg:"$scores.score"}}}, {$group:{_id:"$_id.class_id", avg_score_class:{$avg:"$avg_score"}}}, {$sort:{avg_score_class:1}}])
@kinisoftware
kinisoftware / gist:5282277
Created March 31, 2013 22:34
Course MongoDB Java - Week5 - HW5-4
db.zips.aggregate([{$project:{first_char: {$substr: ["$city", 0, 1]}, pop:1, _id:0}}, {$match:{first_char:{$lte:'9'}}}, {$group:{_id:null, total:{$sum:"$pop"}}}])
@kinisoftware
kinisoftware / paraGon.java
Created April 29, 2013 15:12
Herencia/Jerarquia con array [] en Java
public class Prueba {
public class Padre {
}
public class Hija extends Padre {
@Override
public String toString() {
@kinisoftware
kinisoftware / JettyTestSuite.java
Created May 19, 2013 10:17
Booting Jetty from Java code
@RunWith(Suite.class)
@SuiteClasses({ MyTestClass.class })
public class JettyServerRESTTestSuite {
private static final String APP_NAME = "/context";
private static final int PORT = 4141;
public static final String APP_SERVER_ADDRESS = "http://localhost:" + PORT + APP_NAME + "/rest" + APP_NAME;
private static Server server;