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
/** | |
* DataFromSpreadsheet: Read in Spreadsheet info for a Calculated Datasource in AppMaker. Use a spreadsheet to define a datasource. | |
* Useful for data modeling, simple Apps. | |
* Does not support paging; sheets with large number of rows will see performance penalties | |
* @param {object} params | |
* @param {string} params.spreadsheetId The ID of the source spreadsheet | |
* @param {string} params.sheetName The name of the source sheet | |
* @param {string} params.datasource The name of the target datasource | |
* @param {number} params.numHeaders How many rows are headers (default = 1) | |
* @param {number} params.headerRow Which row contains the name of the field (default=params.numHeaders-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
value | text | |
---|---|---|
Pacific/Midway | (GMT-11:00) Midway | |
Pacific/Niue | (GMT-11:00) Niue | |
Pacific/Pago_Pago | (GMT-11:00) Pago Pago | |
Pacific/Honolulu | (GMT-10:00) Hawaii Time | |
Pacific/Johnston | (GMT-10:00) Johnston | |
Pacific/Rarotonga | (GMT-10:00) Rarotonga | |
Pacific/Tahiti | (GMT-10:00) Tahiti | |
Pacific/Marquesas | (GMT-09:30) Marquesas | |
America/Anchorage | (GMT-09:00) Alaska Time |
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
# Converts a JSONL file generated with telegram-history-dump (1) to CSV | |
# Usage: python telegram-csv.py <path to json file> <path to output csv file> | |
# Example: python telegram-csv.py Bob.json Bob.csv | |
# 1: https://github.com/tvdstaaij/telegram-history-dump | |
from datetime import datetime | |
import unicodecsv as csv | |
import json, sys | |
def get_isodate(msg): | |
date = msg.get("date", None) |
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
'use strict'; | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const functions = require('firebase-functions'); // Cloud Functions for Firebase library | |
const DialogflowApp = require('actions-on-google').DialogflowApp; // Google Assistant helper library | |
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { | |
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); | |
if (request.body.queryResult) { |
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
const ua = require("universal-analytics"); | |
const request = require("request-promise"); | |
const { https } = require("firebase-functions"); | |
function getUserID (obj) { | |
if (!obj.source) { | |
return "dialogflow"; | |
} else { | |
switch (obj.source) { | |
case "twilio": |
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
'use strict'; | |
// @ts-ignore | |
const dialogflow = require('dialogflow'); | |
const fs = require('fs'); | |
/** | |
* Detect dialogflow intent | |
* @param {String} botId | |
* @param {String} sessionId |
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
const Dialogflow = { | |
fulfillmentMessages: [], | |
text: function (txt) { | |
// console.log(typeof txt); | |
if (typeof txt === 'string') { | |
txt = `${txt}` | |
} else { | |
txt = `${txt.title}\n\n${txt.upvotes} upvotes | ${txt.comments} comments\n\n` |
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 getInfo(contexts) { | |
var product = contexts[contexts.length - 1]['parameters']['Product'] | |
var state = contexts[contexts.length - 1]['parameters']['geo-state-us'] | |
for (var i = 0; i < contexts.length; i++) { | |
var context = contexts[i]['parameters'] | |
if (typeof context['Product'] != "undefined" && typeof context['geo-state-us'] != "undefined") { | |
return context | |
} |
OlderNewer