- 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
<InstantSearch | |
indexName={ALGOLIA_INDEX_PROJECT} | |
searchClient={searchClient} | |
routing={routing} | |
future={{ | |
preserveSharedStateOnUnmount: true, | |
}} | |
onStateChange={({uiState, setUiState}) => { | |
if (firstRender.current) { | |
firstRender.current = false; |
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
// This code fails with the error described in: | |
// https://github.com/googleapis/google-cloud-node/issues/4361 | |
// | |
// The Node/JS version of the SDK currently does not support adding LogEvent policies. | |
// | |
// | |
// To run this code: | |
// - save to a file (e.g. "create-alerts.js") | |
// - be logged into your gcloud account (`gcloud auth login`) | |
// - set the env var `PROJ_ID` with your project ID |
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
/* | |
* This file is used to dynamically import and export functions from the `fs`, `http`, `sched`, and `storage` directories. | |
* The exported functions are then used in the `index.ts` file to define the Cloud Functions. | |
* | |
* Only files with the extension `.f.ts` are imported and exported (well, `.f.js` after `tsc` has run). | |
* | |
* Concept for this is inspired by https://codeburst.io/organizing-your-firebase-cloud-functions-67dc17b3b0da | |
* -- Thank you @TarikHuber !! | |
*/ | |
import * as fs from 'fs'; |
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
#!/bin/bash | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
blue=$(tput setaf 6) | |
yellow=$(tput setaf 3) | |
reset=$(tput sgr0) | |
ROOT=$(pwd) | |
echo "" |
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
// | |
// `npx expo install cuid` | |
// | |
import {myStorage} from '../myFirebase'; | |
import {getAuth} from 'firebase/auth'; | |
import {ref, child, put} from 'firebase/storage'; | |
import cuid from 'cuid'; | |
/** |
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
/** | |
* 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> | |
NewerOlder