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
function init() { | |
// Ask user for input, store in userKilometers. | |
let userKilometers = display('How many kilometers to convert?') | |
// Get amount of miles from the amount of kilometers, store in convertedMiles. | |
let convertedMiles = milesTotal(userKilometers); | |
// Display the amount of miles. | |
display('You have driven ${convertedMiles} in total!') | |
} | |
function milesTotal(userKilometers) |
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
{ | |
"entry": [{ | |
"id": "39067632506", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender":{ | |
"id": "1713278708698563" | |
}, | |
"recipient":{ | |
"id": "39067632506" |
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
/** | |
* sendEngagement - Sends an engagement message to all users. | |
* | |
* @param {Object} req The request object. | |
* @param {Object} res The response object. | |
*/ | |
export function sendEngagement(req, res) { | |
let engagement = req.body.engagement; | |
Bot.findOne({ |
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
========================== | |
Image reference | |
========================== | |
http://i.imgur.com/lb5mqqP.png | |
========================== | |
JSON | |
========================== | |
{ | |
"_id": { |
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
================ | |
Get started | |
================ | |
{ | |
"entry": [{ | |
"id": "39067632506", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender": { | |
"id": "1713278708698563" |
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
module.exports = "facebook"; | |
(function(window, angular, undefined) { | |
'use strict'; | |
// Module global settings. | |
var settings = {}; | |
// Module global flags. | |
var flags = { |
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
find . -maxdepth 2 | # Find files | |
grep ".html" | # Grep for all html files | |
xargs -I % grep "\"solution-apis-used_list_item\"" % | # Search for a string in those files | |
wc -l # Return number of found instances |
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
// Simulate get started | |
{ | |
"entry": [{ | |
"id": "<PAGE_ID>", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender": { | |
"id": "<USER_ID>" | |
}, | |
"recipient": { |
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
//// | |
// Get started | |
// This is a webhook postback with event (an event determines which API.ai intent | |
// will fire when a button with an event payload is clicked). | |
// See example: http://i.imgur.com/jPFHuZ2.png (see events, in this case, the | |
// getstarted intent will fire because in the payload, the event is getStarted. | |
// It's like a unique identifier. | |
//// | |
{ | |
"entry": [{ |
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
{ | |
"entry": [{ | |
"id": "39067632506", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender": { | |
"id": "1713278708698563" | |
}, | |
"recipient": { | |
"id": "39067632506" |
NewerOlder