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
| /** | |
| * Creates a menu entry in the Google Docs UI when the document is opened. | |
| * | |
| * @param {object} e The event parameter for a simple onOpen trigger. To | |
| * determine which authorization mode (ScriptApp.AuthMode) the trigger is | |
| * running in, inspect e.authMode. | |
| */ | |
| function onOpen(e) { | |
| DocumentApp.getUi().createAddonMenu() | |
| .addItem('Clean Table of Contents', 'cleanToC') |
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
| import Foundation | |
| class Alf { | |
| static var numberOfInstances = 0 | |
| init() { | |
| Alf.numberOfInstances += 1 | |
| print("Alf instances: \(Alf.numberOfInstances)") | |
| } | |
| deinit { | |
| Alf.numberOfInstances -= 1 |
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
| var fbScripTag = document.createElement('script'); | |
| fbScripTag.setAttribute('src','https://www.gstatic.com/firebasejs/4.8.1/firebase.js'); | |
| document.head.appendChild(fbScripTag); |
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
| import * as express from 'express' | |
| import * as bodyParser from 'body-parser' | |
| const serverless = require('serverless-http') | |
| import { createDialogflowApp } from './src/app' | |
| export const expressApp = express() | |
| expressApp.use(bodyParser.json()); | |
| expressApp.post('/fulfillment', createDialogflowApp) | |
| module.exports.fulfillment = serverless(expressApp) |
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
| import { Request, Response } from 'express' | |
| import { DialogflowApp } from 'actions-on-google' | |
| // Import actions here. | |
| export function createDialogflowApp(request: Request, response: Response) { | |
| const dialogflowApp = new DialogflowApp({request, response}) | |
| interface Action { | |
| name: string, | |
| handler: (app: DialogflowApp) => void |
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
| package: | |
| exclude: | |
| include: | |
| - src/**/* |
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
| plugins: | |
| - serverless-plugin-typescript | |
| - serverless-offline |
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
| functions: | |
| fulfillment: | |
| handler: handler.fulfillment | |
| events: | |
| - http: | |
| path: fulfillment | |
| method: post |
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
| import { DialogflowApp } from 'actions-on-google' | |
| export const name = 'demo_action' | |
| export function handler(app: DialogflowApp) { | |
| const paramNumber = parseInt(app.getArgument('number').toString()) | |
| app.tell(`I incremented your number. Here you go: ${paramNumber + 1}`) | |
| } |
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
| ... | |
| // Import actions here. | |
| import * as DemoAction from './actions/DemoAction' | |
| ... | |
| const actions: Action[] = [ | |
| // Add actions here. | |
| DemoAction | |
| ] | |
| ... |
OlderNewer