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
name: Firestore Backups | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: 'Backup' | |
default: 'Backup' | |
required: false | |
schedule: | |
- cron: '0 0 1-31/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
const [cookies, setCookie] = useCookies(['frbstkn', 'redirect']) | |
useEffect(() => { | |
auth.onAuthStateChanged((user) => { | |
if (user) getCustomToken() | |
}) | |
}, []) | |
const getCustomToken = async () => { | |
if (auth.currentUser === null) return |
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 * as functions from 'firebase-functions' | |
import * as service from './service.json' | |
import admin = require('firebase-admin') | |
const params = { | |
type: service.type, | |
projectId: service.project_id, | |
privateKeyId: service.private_key_id, | |
privateKey: service.private_key, | |
clientEmail: service.client_email, |
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, useLayoutEffect, useRef } from 'react' | |
function MyComponent() { | |
const [windowSize, _setWindowSize] = useState([ | |
window.innerWidth, | |
window.innerHeight, | |
]) | |
const windowSizeRef = useRef(windowSize) | |
const setWindowSize = (value) => { |
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, useLayoutEffect, useRef } from 'react' | |
function MyComponent() { | |
const [windowSize, _setWindowSize] = useState([0, 0]) | |
const windowSizeRef = useRef(windowSize) | |
const setWindowSize = (value) => { | |
windowSizeRef.current = value | |
_setWindowSize(value) | |
} |
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, useLayoutEffect, useRef } from 'react' | |
function MyComponent() { | |
useLayoutEffect(() => { | |
function onWindowResize() {} | |
return () => {} | |
}, []) | |
return <div>Hi There</div> | |
} |
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, useLayoutEffect, useRef } from 'react' | |
function MyComponent() { | |
return <div>Hi There</div> | |
} | |
export default MyComponent |
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
<script> | |
let todoDescription = ""; | |
let todosList = []; | |
const onAddToList = () => { | |
todosList = [ | |
...todosList, | |
{ | |
id: new Date().getTime(), | |
description: todoDescription, |
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
<script> | |
export let dark; | |
function handleToggle() { | |
dark = !dark; | |
} | |
</script> | |
<style> | |
.container { |
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 pickImage = async () => { | |
let result = await ImagePicker.launchCameraAsync({ | |
mediaTypes: ImagePicker.MediaTypeOptions.Images, | |
allowsEditing: true, | |
aspect: [1, 1], | |
quality: 1, | |
base64: true | |
}) | |
if (!result.cancelled){ | |
// I'm adding the data:image, if you want to use the image locally before uploading, you can use a state hook first |
NewerOlder