This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const env = require('node-env-file'); | |
env(__dirname + '/.env'); | |
// put .env in .gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var strip = require('./strip.js'); | |
this.emit(":askWithCard", speechOutput, repromptText, this.t("MESSAGE"), strip.stripTags(repromptText)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cloud functions must return int and take one String | |
// see https://docs.particle.io/reference/firmware/photon/#particle-function- | |
int switchOn(String s); | |
int switchOff(String s); | |
int led = D7; | |
void setup() { | |
pinMode(led, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"lambda:InvokeFunction", | |
"polly:SynthesizeSpeech", | |
"lex:*" | |
], | |
"Effect": "Allow", |