Skip to content

Instantly share code, notes, and snippets.

View Thermometer_package.json
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "8"
},
View Thermometer_index.js
'use strict';
const functions = require('firebase-functions');
const { dialogflow } = require('actions-on-google');
const ambient = require('ambient-lib');
// Ambient Settings
const AMBIENT_CHANNEL_ID = XXXX;
const AMBIENT_WRITE_KEY = 'YYYYYYYYYYYYYYYY';
const AMBIENT_READ_KEY = 'ZZZZZZZZZZZZZZZZ';
View RoomLight_package.json
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "8"
},
View kousen.html
<!-- HTML Example -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://obniz.io/js/jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://unpkg.com/obniz@1.9.3/obniz.js" crossorigin="anonymous"></script>
</head>
<body>
View private_LightOn.html
<!-- HTML Example -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://obniz.io/js/jquery-3.2.1.min.js"></script>
<script src="https://unpkg.com/obniz@latest/obniz.js"></script>
</head>
<body>
<div id="obniz-debug"></div>
View RoomLight_fulfillment.js
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
// for Dialogflow fulfillment library docs, samples, and to report issues
'use strict';
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const request = require('request');
View LightOn.js
const Obniz = require("obniz");
const express = require('@runkit/runkit/express-endpoint/1.0.0');
const app = express(exports);
const yourObnizId = "OBNIZ_ID" // write your obniz id
app.get('/', async (req,res) =>{
let obniz = new Obniz(yourObnizId);
let connected = await obniz.connectWait({timeout:10});
View RoomLightSwitch.html
<!-- HTML Example -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://obniz.io/js/jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://unpkg.com/obniz@latest/obniz.js"></script>
</head>
<body>
View md_code_generater.sh
#!/bin/bash
fname=$1
cat ${fname} | while IFS= read line; do
if [ -n "${line}" ]; then
echo " ${line}"
else
echo " "
fi
done
View ConcatTimestamp.rb
#!/usr/bin/env ruby
=begin
Group Watcherで生成したCSVの開始日と開始時刻、
および終了日と終了時刻を一列にまとめて、
elasticsearchのdate型に合わせる。
Group Watcherが生成するCSVのヘッダは次の通り。
"開始日","開始時刻","終了日","終了時刻","件名",
"場所","/","分類","グループ名","ユーザー名",
"内容","アラーム オン/オフ","アラーム日付","アラーム時刻"
You can’t perform that action at this time.