Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
@dileephell
dileephell / wirt.js
Last active April 16, 2018 16:06
wit
var express = require('express');
var app = express();
var path = require('path');
var chatflow = require('./chatflow.js');
const fs = require('fs');
const request = require('request');
const url = require('url');
@dileephell
dileephell / lambda.js
Last active April 5, 2018 15:40
weatherApi.js
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / lambda.js
Created March 28, 2018 08:27
dataApi.js
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / lambda.js
Created March 21, 2018 11:17
Lambda api
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / lambda.js
Created March 16, 2018 12:28
Undefined
Response:
{
"errorMessage": "Cannot read property 'isValid' of undefined",
"errorType": "TypeError",
"stackTrace": [
"getWeatherUpdate (/var/task/index.js:117:29)",
"exports.handler.err (/var/task/index.js:148:2)"
]
}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<title>Chatbot UI iFrame Example</title>
<!-- bot css -->
<link rel="stylesheet" type="text/css" href="./chatbot-ui-iframe-loader.css">
<!-- bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
var express = require('express');
var session = require('express-session');
var bodyParser = require('body-parser');
var app = express();
var path = require('path');
var cors = require('cors');
app.use(cors());
// app.all('*', function(req, res, next){
var http = require('http');
exports.handler = (event, context,callback) => {
function getJSON(options, callback){
http.request(options, function(res){
var body = "";
console.log('calling the http');
res.on('data', function(chunk){
console.log('body' + chunk);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@dileephell
dileephell / 0.md
Created September 18, 2017 07:18 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)