Skip to content

Instantly share code, notes, and snippets.

View kiramishima's full-sized avatar
🕹️
https://www.twitch.tv/kiramishima

Paul Arizpe kiramishima

🕹️
https://www.twitch.tv/kiramishima
View GitHub Profile
@kiramishima
kiramishima / app.js
Created August 27, 2015 23:02
Piramides
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 */
@kiramishima
kiramishima / .env
Last active June 7, 2017 22:19
Bot Framework Basic Template
MICROSOFT_APP_NAME=<Nombre de Tu Bot>
MICROSOFT_APP_ID=<Tu App Id>
MICROSOFT_APP_PASSWORD=<Tu App Password>
@kiramishima
kiramishima / bash
Last active June 21, 2017 21:23
Started with Bot Framework in NodeJS
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
@kiramishima
kiramishima / app.js
Created June 21, 2017 21:30
Getting started with Bot Framework on NodeJS
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);
});
@kiramishima
kiramishima / .env
Created June 21, 2017 21:43
Getting Started with Bot Framework on NodeJS
MICROSOFT_APP_NAME=<Nombre de Tu Bot>
MICROSOFT_APP_ID=<Tu App Id>
MICROSOFT_APP_PASSWORD=<Tu App Password>
@kiramishima
kiramishima / LUIS en app.
Created July 9, 2017 05:21
Bot Inteligentes con LUIS
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."))
@kiramishima
kiramishima / Agregando dialogos.js
Created July 9, 2017 05:26
Bot Inteligentes con LUIS
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){
@kiramishima
kiramishima / app.js
Created July 9, 2017 05:29
Bot Inteligentes con LUIS Raw
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 () {
@kiramishima
kiramishima / socketmq.js
Created August 28, 2017 22:36
RMQ + Socket.io
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
@kiramishima
kiramishima / sample_module.js
Created September 16, 2017 22:00
Ejemplo de Modulo
/*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;