Skip to content

Instantly share code, notes, and snippets.

View kinisoftware's full-sized avatar

Joaquin Engelmo Moriche kinisoftware

View GitHub Profile
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "",
"application": {
"applicationId": ""
},
"user": {
"userId": ""
public class CancelAndStopIntentHandler implements RequestHandler {
@Override
public boolean canHandle(HandlerInput input) {
return input.matches(intentName("AMAZON.StopIntent").or(intentName("AMAZON.CancelIntent")));
}
@Override
public Optional<Response> handle(HandlerInput input) {
String text = "Gracias por usar Estrenos de cine";
public class UpcomingMoviesStreamHandler extends SkillStreamHandler {
public static final String CARD_TITLE = "Estrenos de cine";
public UpcomingMoviesStreamHandler() {
super(getSkill());
}
private static Skill getSkill() {
return Skills.standard()
@kinisoftware
kinisoftware / pom.xml
Last active February 1, 2019 14:20
Post - dependencies for skill backend
<dependencies>
<dependency>
<groupId>com.amazon.alexa</groupId>
<artifactId>ask-sdk</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j2</artifactId>
<version>1.0.0</version>
@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;
@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 / 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 / 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: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"}}}])
/* ====================================================================
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