This file contains 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
""" | |
DialogFlow Echo Response Fulfillment | |
Run ngrok: | |
https://ngrok.com/download | |
./ngrok http 8080 | |
Setup: | |
pip install fastapi uvicorn |
This file contains 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
""" | |
FastAPI demo showing automatic string-to-dataclass parameter conversion | |
Based on the quickstart demo found at https://fastapi.tiangolo.com/#create-it | |
""" | |
from fastapi import FastAPI, Path | |
# NOTE: Imports from stdlib instead of pydantic | |
from dataclasses import dataclass |
This file contains 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
""" | |
Sample Quart app with Rollbar integration | |
Adapted from the Flask example | |
https://github.com/rollbar/rollbar-flask-example/blob/master/hello.py | |
""" | |
from quart import Quart | |
app = Quart(__name__) |
This file contains 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 redis | |
class TinyQueue(object): | |
""" | |
A single-item queue to share data between sandboxed projects using Redis | |
Instances of this class with the same 'tag' will be connected | |
'overwrite' will cause new push data to overwrite the previous | |
overwrite=False -> FIFO |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
path { | |
fill: none; | |
stroke-linejoin: round; | |
} | |
.sphere, |