Skip to content

Instantly share code, notes, and snippets.

View CodingDoug's full-sized avatar

Doug Stevenson CodingDoug

View GitHub Profile
@CodingDoug
CodingDoug / README.md
Created December 5, 2019 02:24
How to schedule a Cloud Function to run in the future (in order to build a Firestore document TTL)
@CodingDoug
CodingDoug / README.md
Last active July 11, 2023 14:04
Patterns for security with Firebase Authentication: offload work to Cloud Functions

This is the runnable sample code from the blog post [Patterns for security with Firebase Authentication: offload work to Cloud Functions][1]. It discusses offloading work from a client app to Cloud Functions using an authentication trigger.

  1. Create a new Firebase project
  2. Enable email/password authentication
  3. Provision Cloud Firestore and apply the rules given in this gist
  4. Use the Firebase CLI to create a workspace for Functions using TypeScript
  5. Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work).
  6. Deploy the function code to Cloud Functions using the Firebase CLI
@CodingDoug
CodingDoug / README.md
Last active December 14, 2022 09:48
Realtime Database triggers with Cloud Functions for Firebase - source

Realtime Database triggers with Cloud Functions for Firebase - source

This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:

  1. Part 1 (intro, onCreate)
  2. Part 2 (onUpdate, infinite loops)
  3. Part 3 (onDelete, transactions)

index.ts contains the Cloud Functions code, and dialog.ts contains the script to run

@CodingDoug
CodingDoug / README.md
Last active November 6, 2022 09:29
Example code from the video "Use async/await with TypeScript in Cloud Functions"

Example code from the video "Use async/await with TypeScript in Cloud Functions"

This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.

Watch the video here

The code in this project is licensed under the Apache License 2.0.

Copyright 2018 Google LLC
@CodingDoug
CodingDoug / README.md
Last active May 6, 2021 14:35
Building an assistant (chatbot) that translates languages, integrated with Slack
@CodingDoug
CodingDoug / README.md
Last active March 12, 2022 03:19
Aggregating Twitter search results and displaying them on a web page in realtime

Aggregating Twitter search results and displaying them on a web page in realtime

If you're trying to do this, you came to the right place!

See this code in action here: https://twitter.com/CodingDoug/status/948225623939473413

Setup

These instructions assume that you already have a Firebase project, and you've provisioned Firestore in it.

@CodingDoug
CodingDoug / README.md
Last active October 3, 2020 20:18
Uploading images to Cloud Storage via the web and identifying them with Google Cloud Vision API

Uploading images to Cloud Storage via the web and identifying them with Google Cloud Vision API

If you're trying to do this, you came to the right place!

Watch this code work in real time: https://twitter.com/CodingDoug/status/945035556555186176

Setup

These instructions assume that you already have a Firebase project, and billing is enabled. Billing is required to use the Vision API.

@CodingDoug
CodingDoug / README.md
Last active August 3, 2023 16:41
Copying Data from a Google Sheet into Firebase Realtime Database in real time via Apps Script
@CodingDoug
CodingDoug / README.md
Last active December 17, 2022 10:23
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions