Skip to content

Instantly share code, notes, and snippets.

View memodoring's full-sized avatar

Memo Döring memodoring

View GitHub Profile
customer obsession
ownership
invent and simplify
are right a lot
learn and be curious
hire and develop the best
insist on the highest standards
think big
bias for action
frugality
@memodoring
memodoring / canHandle example
Created May 9, 2018 16:43
A sample canHandle for the Alexa SDK V2
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
||
(request.type === 'IntentRequest' && request.intent.name === 'GetNewFactIntent');
@memodoring
memodoring / handle example
Created May 9, 2018 16:52
A sample handle for the Alexa SDK V2 for Node.js
handle(handlerInput) {
const factArr = data;
const factIndex = Math.floor(Math.random() * factArr.length);
const randomFact = factArr[factIndex];
const speechOutput = GET_FACT_MESSAGE + randomFact;
@memodoring
memodoring / responseBuilder example
Created May 9, 2018 16:54
A sample of building a response with the Alexa SDK V2 for Node.js
return handlerInput.responseBuilder
.speak(speechOutput)
.withSimpleCard(SKILL_NAME, randomFact)
.reprompt(‘Would you like another fact?’)
.getResponse();
@memodoring
memodoring / Registering Handlers Sample
Created May 9, 2018 16:58
A sample of registering handlers in the Alexa SDK V2 for Node.js
skillBuilder.addRequestHandlers(
GetNewFactHandler,
HelpHandler,
ExitHandler,
SessionEndedRequestHandler
@memodoring
memodoring / GDLWorkshop
Last active September 5, 2018 19:02
Datos del espacio multilenguaje
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const ESLaunchRequestHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return (request.type === 'LaunchRequest'
&& request.locale === `es-MX` );
@memodoring
memodoring / asynchttp.js
Last active November 1, 2018 05:47
Async https call
async function httpRequestPromise(options) {
//log the options in case we need to debug
console.log(`~~~~~~~~~~~~~~~${JSON.stringify(options)}~~~~~~~~~~~~~`);
// return new pending promise
return new Promise((resolve, reject) => {
const request = http.request(options, (response) => {
// reject the promise if the HTTP status isn't `Successful 2xx`
if (response.statusCode < 200 || response.statusCode > 299) {
reject(new Error('Failed to load page, status code: ' + response.statusCode));
}
@memodoring
memodoring / es-MX.json
Created October 31, 2018 22:12
AD2 CDMX - Checkpoint 3
{
"interactionModel": {
"languageModel": {
"invocationName": "curiosidades espaciales",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
@memodoring
memodoring / index.js
Last active November 9, 2018 22:26
AD2 CDMX - Checkpoint 4
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const GetNewFactHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
@memodoring
memodoring / es-MX.json
Last active November 9, 2018 22:26
AD2 CDMX - Checkpoint 5
{
"interactionModel": {
"languageModel": {
"invocationName": "curiosidades espaciales",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{