- Ensure you have these installed and accessible from the notebook pyngrok, nest_asyncio, fastapi, uvicorn and other libs you want
%pip install pyngrok nest_asyncio fastapi uvicorn loguru
- Create a FastAPI app
from fastapi import FastAPI
| /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 |
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| /* CSS */ | |
Find the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| // ~/server/api/sse.ts | |
| export default defineEventHandler(async (event) => { | |
| if (!process.dev) return { disabled: true } | |
| // Enable SSE endpoint | |
| setHeader(event, 'cache-control', 'no-cache') | |
| setHeader(event, 'connection', 'keep-alive') | |
| setHeader(event, 'content-type', 'text/event-stream') | |
| setResponseStatus(event, 200) |