See the Summary section.
This file contains hidden or 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 React component: | |
* r1. name starts with a Capital letter | |
* r2. gets a single argument, typically referred to as "props", that is an object containing all properties passed in | |
* r3. can use hooks (useState, useEffect, useRef, etc...) | |
* r4. returns JSX | |
**/ | |
/** r1. name starts with a Capital letter */ | |
/** r2. gets a single argument, typically named "props" */ |
This file contains hidden or 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_field_to_all_docs_in_collection.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/cleanup/. | |
* | |
* To use: | |
* 1. Import the 'firebase' and 'esm' NPM modules to your project (Run the command: `npm install firebase esm`) | |
* 2. Edit the data for USER1 and FIREBASE_CONFIG, then adjust parameters in `main` for the call to `visitDocs`. | |
* |
This file contains hidden or 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 answer comes in 2 flavours: the "plays nice with others" version and the "hax0rz rUlez!!" version. | |
// | |
//-------------------------------------------------------------------------------------- | |
// PLAYS NICE WITH OTHERS: | |
// | |
const arr2num = (arr) => { | |
return arr | |
.reverse() // work from least-to-most significant digits | |
.reduce( |
This file contains hidden or 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
/** | |
* get_firestore_collection_as_json.js | |
* | |
* This code is a "node script" used to fetch all documents from a Firestore collection, | |
* either in "the cloud" or the emulator, and write them to a file as JSON. | |
* | |
* The script is a "client app", so it logs in with Firebase Auth using email/password from the variable USER1. | |
* This USER1 user ([email protected]) must exist in your Firebase project and have read access | |
* to the collection(s) you are populating. You can create that account via | |
* Firebase Console >> Authentication. |
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#include <ESP8266HTTPClient.h> | |
const char* ssid = "xxx"; | |
const char* password = "xxxxxxx"; | |
const char* url = "https://api.angelcam.com/v1/events/"; | |
const char* fingerprint = "51 87 10 92 52 38 41 A9 SD 23 V3 23 72 58 SE EF 06 8D 35 4C"; |
This file contains hidden or 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 hidden or 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
09-26 13:53:23.229 1397 5471 W audio_hw_generic: Not supplying enough data to HAL, expected position 2427928 , only wrote 2427853 | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: Error while updating prop left | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: java.lang.reflect.InvocationTargetException | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: at java.lang.reflect.Method.invoke(Native Method) | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: at abi38_0_0.com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:7) | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: at abi38_0_0.com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:2) | |
09-26 13:53:23.236 6517 6654 E unknown:ViewManager: at abi38_0_0.com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:14) | |
09-26 13:53:23.236 6517 6654 E unknown:ViewMa |
This file contains hidden or 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 hidden or 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
/** | |
* load_json_to_firstore.js | |
* | |
* This code is a "node script" used to load data into your Firestore database, either in "the cloud" or the emulator. | |
* | |
* The script is a "client app", so it logs in with Firebase Auth using email/password from the variable USER1. | |
* | |
* The USER1 user ([email protected]) must exist in your Firebase project and have write access | |
* to the collection(s) you are populating. You can create that account via Firebase Console >> Authentication. | |
* |