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, { useState } from 'react'; | |
function Example() { | |
// Declare a new state variable, which we'll call "count" | |
const [count, setCount] = useState(0); | |
return ( | |
<div> | |
<p>You have written {count} hooks</p> | |
<button onClick={() => setCount(count + 1)}> |
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, { useState, useEffect } from 'react'; | |
function Example() { | |
// Declare a new state variable, which we'll call "count" | |
const [count, setCount] = useState(0); | |
useEffect(() => { | |
// Update the document title using the browser API | |
document.title = `You have written ${count} hooks`; | |
}); |
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
virtualenv env |
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
pip install firebase-admin google-cloud-firestore |
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 firebase_admin | |
import google.cloud | |
from firebase_admin import credentials, firestore | |
cred = credentials.Certificate("./ServiceAccountKey.json") | |
app = firebase_admin.initialize_app(cred) | |
store = firestore.client() | |
doc_ref = store.collection(u'users').limit(2) |
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 firebase_admin | |
import google.cloud | |
from firebase_admin import credentials, firestore | |
cred = credentials.Certificate("./ServiceAccountKey.json") | |
app = firebase_admin.initialize_app(cred) | |
store = firestore.client() | |
doc_ref = store.collection(u'test') |
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 csv | |
import firebase_admin | |
import google.cloud | |
from firebase_admin import credentials, firestore | |
cred = credentials.Certificate("./ServiceAccountKey.json") | |
app = firebase_admin.initialize_app(cred) | |
store = firestore.client() |
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 firebase_admin | |
from firebase_admin import credentials, firestore | |
cred = credentials.Certificate("./ServiceAccountKey.json") | |
app = firebase_admin.initialize_app(cred) | |
store = firestore.client() | |
doc_ref = store.collection(u'COLLECTION_TO_CHECK') | |
data = [] |
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
export const UseState = () => { | |
//Declare state value of count and setCount function to update | |
//set the initial value of count as 0 | |
const [count, setCount] = useState(0); | |
//setCount function | |
return ( | |
<div className='content'> | |
<h4>UseState</h4> | |
<p>You clicked {count} times</p> |
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 csv | |
import firebase_admin | |
import google.cloud | |
from firebase_admin import credentials, firestore | |
cred = credentials.Certificate("./ServiceAccountKey.json") | |
app = firebase_admin.initialize_app(cred) | |
store = firestore.client() |