Skip to content

Instantly share code, notes, and snippets.

View codefoster's full-sized avatar

Jeremy Foster codefoster

View GitHub Profile
@codefoster
codefoster / index.ts
Created March 15, 2018 19:00
Bot Framework v4 m2 Echo Bot with BotFrameworkAdapter
import { BotFrameworkAdapter } from 'botbuilder';
import * as restify from 'restify';
let server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log(`${server.name} listening to ${server.url}`);
});
const adapter = new BotFrameworkAdapter();
@codefoster
codefoster / index.ts
Created March 15, 2018 16:48
Bot Framework v4 m2 Echo Bot with Console Adapter
import { ConsoleAdapter } from 'botbuilder';
new ConsoleAdapter().listen(ctx => {
if (ctx.request.type === 'message')
ctx.sendActivity(ctx.request.text);
})
export COGNITIVE_SERVICES_KEY=d7889254b9244ec1ba54e8cf154ff359
HostName=cfhub.azure-devices.net;DeviceId=dxpi17;SharedAccessKey=gWAQDI68nZPb3qgoFG+To/E0YQIw+JZBxsnqgKJH2mI=
HostName=cfhub.azure-devices.net;DeviceId=dxpi20;SharedAccessKey=S1Ls1kp/LONWfXmMTVoc4b/X1OcXPXZ1ofbZTGy06rQ=
HostName=cfhub.azure-devices.net;DeviceId=dxpi12;SharedAccessKey=zM2TXZoeWDyWwwegM2knH6UtqiIZwfjah6vegKQ/9Sk=
HostName=cfhub.azure-devices.net;DeviceId=dxpi11;SharedAccessKey=8by1YuKZ5yDpUG5J7esQKXV2RPx2f+MuZaL6WWWkJFs=
HostName=cfhub.azure-devices.net;DeviceId=dxpi08;SharedAccessKey=37KdRdNTxG4QOJwUfHx/GaW8or+QCqp5uyOcY4dWtnY=
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
@codefoster
codefoster / extensions.json
Last active October 25, 2016 17:07
Visual Studio code settings
[
{
"metadata": {
"galleryApiUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"id": "214cbfb9-7c06-4467-bad4-357ae83eb587",
"publisherId": "4434843a-4ebf-4f44-84f5-4176380c492d",
"publisherDisplayName": "johnpapa"
},
"name": "Angular2",
"publisher": "johnpapa",
{
"files.exclude": {
"app/**/*.js": true,
"app/**/*.js.map": true
}
}
else if (args.detail.kind === activation.ActivationKind.voiceCommand) {
var command = args.detail.result.semanticInterpretation.properties.command[0];
WinJS.xhr({ url: 'http://CommandMonkey.azurewebsites.net/api/command?cmd=' + command });
}
var sf = Windows.Storage.StorageFile;
var vcm = Windows.Media.SpeechRecognition.VoiceCommandManager;
sf.getFileFromApplicationUriAsync(new Windows.Foundation.Uri("ms-appx:///vcd.xml"))
.then(function (file) {
vcm.installCommandSetsFromStorageFileAsync(file);
});
@codefoster
codefoster / vcd.xml
Created February 11, 2015 05:45
The Voice Command Definition (VCD) file for Command Monkey
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en-us" Name="examplevcd">
<CommandPrefix>Monkey</CommandPrefix>
<Example>Command the monkey!</Example>
<Command Name="command">
<Example>dance</Example>
@codefoster
codefoster / myfile
Created October 1, 2013 16:38
Test gist
function myfunction() {
alert('hi');
}