This file contains 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
function ConstruirPiramide(n) | |
{ | |
var ladrillo = { | |
a: '<span class="bloque bloque-a"></span>', | |
b: '<span class="bloque bloque-b"></span>', | |
}; | |
var contenedor = document.getElementById("contenedor"); | |
/* Implementar tu código */ |
This file contains 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
MICROSOFT_APP_NAME=<Nombre de Tu Bot> | |
MICROSOFT_APP_ID=<Tu App Id> | |
MICROSOFT_APP_PASSWORD=<Tu App Password> |
This file contains 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
echo "Copy & Paste app.js from Gist -> app.js (loool :P ) and Save" | |
mkdir hellobot | |
cd hellobot | |
npm init -y | |
npm install dotenv botbuilder restify --save | |
touch app.js | |
touch .env | |
vim app.js |
This file contains 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
require('dotenv').config(); // Cargo la informacion de mi archivo en .env para obtener los valores en process.env.{Variable} | |
var restify = require('restify'); | |
var builder = require('botbuilder'); | |
// Restify Server | |
var server = restify.createServer(); | |
server.listen(process.env.port || process.env.PORT || 3978, function () { | |
console.log('%s listening to %s', server.name, server.url); | |
}); |
This file contains 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
MICROSOFT_APP_NAME=<Nombre de Tu Bot> | |
MICROSOFT_APP_ID=<Tu App Id> | |
MICROSOFT_APP_PASSWORD=<Tu App Password> |
This file contains 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 model = process.env.LUIS_MODEL; | |
var recognizer = new builder.LuisRecognizer(model); | |
var intents = new builder.IntentDialog({ recognizers: [recognizer] }); | |
bot.dialog('/', intents); | |
intents.matches('None', '/none') | |
.matches('GetWeather', '/getWeather') | |
.matches('BookFlight', '/bookFlight') | |
.onDefault(builder.DialogAction.send("I'm sorry. I didn't understand.")) |
This file contains 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
bot.dialog('/none', function(session){ | |
session.send("No intent"); | |
}) | |
bot.dialog('/getWeather', function(session){ | |
//Add custom code here to implent get weather feature | |
session.send("GetWeather intent"); | |
}) | |
bot.dialog('/bookFlight', function(session){ |
This file contains 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 builder = require('botbuilder'); | |
var restify = require('restify'); | |
//========================================================= | |
// Bot Setup | |
//========================================================= | |
// Setup Restify Server | |
var server = restify.createServer(); | |
server.listen(process.env.port || process.env.PORT || 3978, function () { |
This file contains 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
import * as SocketIO from 'socket.io'; | |
import * as socketioJwt from "socketio-jwt"; | |
import amqp from 'amqplib/callback_api'; | |
/** Start */ | |
export function startSocketServer(server) { | |
// Create SocketIO Listener | |
const io = SocketIO.listen(server); | |
// RabbitMQ Consumer |
This file contains 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
/*Create Function On Fly*/ | |
var Call=function() { | |
console.log("Hello! This is Call Function"); | |
} | |
/*Function Take Name of Function as parameter */ | |
var CallFun=function () { | |
console.log("Invoke call Function"); | |
} | |
/*Export callFun*/ | |
module.exports.Method1 = CallFun; |
OlderNewer