Skip to content

Instantly share code, notes, and snippets.

View gittimos's full-sized avatar

Moritz Strube gittimos

  • Kassel, Germany
View GitHub Profile
@gittimos
gittimos / lex-policy.json
Last active February 9, 2017 09:14
Custom policy for using the AWS Lex API
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"lambda:InvokeFunction",
"polly:SynthesizeSpeech",
"lex:*"
],
"Effect": "Allow",
@gittimos
gittimos / api.js
Last active May 13, 2017 17:46
Using the AWS Lex API with the AWS SDK
let AWS = require('aws-sdk')
let credentials = new AWS.SharedIniFileCredentials({profile: 'default'});
AWS.config.credentials = credentials;
AWS.config.update({region: 'us-east-1'});
let lexruntime = new AWS.LexRuntime({
apiVersion: '2016-11-28',
});
@gittimos
gittimos / blink-an-led.ino
Created February 12, 2017 14:37
Publish Particle functions
@gittimos
gittimos / index.js
Last active August 13, 2021 13:22
Alexa skills kit (ASK): remove SSML for speech output in cards
var strip = require('./strip.js');
this.emit(":askWithCard", speechOutput, repromptText, this.t("MESSAGE"), strip.stripTags(repromptText));
@gittimos
gittimos / lex.js
Last active June 28, 2020 11:47
Using the Lex postText API with AWS Node.js SDK
var AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
var lexruntime = new AWS.LexRuntime();
var params = {
botAlias: '$LATEST', /* required, has to be '$LATEST' */
botName: 'BOT', /* required, the name of you bot */
inputText: 'TEXT', /* required, your text */
userId: 'USER', /* required, arbitrary identifier */
@gittimos
gittimos / Watson.js
Created May 15, 2017 08:03
Using the Watson API with the Node.js SDK
var watson = require('watson-developer-cloud');
// username and password of the service
// see https://www.ibm.com/watson/developercloud/doc/common/getting-started-credentials.html
var conversation = watson.conversation({
username: process.env.WATSON_USERNAME,
password: process.env.WATSON_PASSWORD,
version: 'v1',
version_date: '2017-04-21'
@gittimos
gittimos / env.js
Created May 22, 2017 14:30
Load environment variables stored in .env for node.js applications
const env = require('node-env-file');
env(__dirname + '/.env');
// put .env in .gitignore