- GET request includes query parameters after the
?
symbol. Example:http://locahost:4000/forest?daylight=true
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
/** | |
* firestore_add_doc.js | |
* | |
* This script is assumed to live in an existing Javascript project that has its own package.json. | |
* I store this script in <PROJECT_ROOT>/tools/misc/. | |
* | |
* To use: | |
* 1. npm init -y | |
* 2. npm install firebase esm | |
* 3. Edit this code to set for USER1 and FIREBASE_CONFIG |
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 React from "react"; | |
import {FirebaseProvider} from "contexts/FirebaseContext"; | |
import {AuthProvider} from "contexts/AuthProvider"; | |
const App = () => { | |
return ( | |
<FirebaseProvider> | |
<AuthProvider> | |
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
// version.json: | |
// | |
// { | |
// "version": "3.0.23" | |
// } | |
let VERSION_JSON = `${PROJECT_CONFIG_DIR}/version.json`; | |
versionString = getVersionString(VERSION_JSON); |
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 React, {createContext, useEffect, useState} from "react"; | |
import i18next from "i18next"; | |
import {initReactI18next} from "react-i18next"; | |
import Backend from "i18next-node-firestore-backend"; | |
import {FIRESTORE} from "../myFirebase"; | |
// export const I18NEXT_FS_BKEND_LANGUAGE_LIST_FIELD_NAME = 'languages'; | |
const I18NEXT_DEFAULT_NAMESPACE = "core"; | |
const I18NEXT_FS_BKEND_COLLECTION_NAME = "config/type/i18n"; |
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
const functions = require('firebase-functions'); | |
const firestore = require('@google-cloud/firestore'); | |
const client = new firestore.v1.FirestoreAdminClient(); | |
// | |
// Add config values with CLI command: | |
// firebase functions:config:set my_app_name='{"fsBackupBucket":"gs://my-fs-backup-bucket"}' | |
// | |
const config = functions.config(); |
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
/** | |
* A script that: | |
* 1. loads Google Sheets API keys and spreadsheet IDs (see GOOGLE_API_KEY) | |
* 2. connects to the identifed Google Sheet | |
* 3. grabs the data from a named Worksheet (see SHEET_TO_GET) | |
* 4. iterates over each row (see processUserRows()) | |
* 5. puts them into a JSON structure | |
* 6. and writes that out to a file (see FILE_NAME) | |
* | |
* To run this script, I have this in my package.json: |
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
/* What? | |
* A configuration for standard-version-expo that updates multiple config files | |
* by dynamically identifying them from a sub-directory when you bump the | |
* version using the `standard-version` tool | |
* | |
* How? | |
* Modelled from the post by @bycedric: https://dev.to/bycedric/simplify-expo-releases-with-standard-version-2f4o | |
* Follow the setup instructions listed at the URL above or at https://github.com/expo-community/standard-version-expo | |
* | |
* Why? |
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
// | |
// `npx expo install cuid` | |
// | |
import {myStorage} from '../myFirebase'; | |
import {getAuth} from 'firebase/auth'; | |
import {ref, child, put} from 'firebase/storage'; | |
import cuid from 'cuid'; | |
/** |
- Initialized ExpressJS project as per this gist
project-root
├── node_modules
├── package-lock.json