Skip to content

Instantly share code, notes, and snippets.

View KayLerch's full-sized avatar
🎯
Focusing

Kay L. KayLerch

🎯
Focusing
  • Amazon Web Services
  • Houston, USA
View GitHub Profile
@KayLerch
KayLerch / en-US.js
Last active February 17, 2021 06:39
Optimized i18n request interceptor for Alexa custom skills in Node. Loads only required language assets from external files and provides some convenient functions to read them. Will also let you store localized settings represented as JSON objects in your language files.
module.exports = Object.freeze({
translation: {
welcome: 'Howdy',
images: [
{
background: 'https://image/en-US.png'
},
{
background: 'https://image/en-US2.png'
},
@KayLerch
KayLerch / MyRequestStreamHandler.java
Created October 30, 2017 14:43
Wraps RequestStreamHandler and logs request payload in Alexa Java SDK
import com.amazon.speech.speechlet.SpeechletException;
import com.amazon.speech.speechlet.SpeechletRequestHandlerException;
import com.amazon.speech.speechlet.SpeechletV2;
import com.amazon.speech.speechlet.lambda.LambdaSpeechletRequestHandler;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestStreamHandler;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@KayLerch
KayLerch / AlexaSpeechletResponse.java
Created August 25, 2016 18:25
Wrapped Amazon Alexa SpeechletResponse which provides a builder and solves a bug with shouldEndSession
package me.lerch.alexa.morse.skill.utils;
import com.amazon.speech.speechlet.SpeechletResponse;
import com.amazon.speech.ui.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.lang3.Validate;
public class AlexaSpeechletResponse extends SpeechletResponse {
/**
@KayLerch
KayLerch / weatherstation.py
Created March 28, 2016 10:44
A Python script to propagate DHT22 sensor data to AWS IoT
import Adafruit_DHT
import ssl
import sys
import paho.mqtt.client as mqtt
import time
sensor = Adafruit_DHT.DHT22
pin = 21 # GPIO 21
delaySecondsBetweenPublish = 1