Skip to content

Instantly share code, notes, and snippets.

View alejovdev's full-sized avatar
💻
Coding

Alejov alejovdev

💻
Coding
View GitHub Profile
<script>
let todoDescription = "";
let todosList = [];
const onAddToList = () => {
todosList = [
...todosList,
{
id: new Date().getTime(),
description: todoDescription,
import React, { useState, useLayoutEffect, useRef } from 'react'
function MyComponent() {
return <div>Hi There</div>
}
export default MyComponent
import React, { useState, useLayoutEffect, useRef } from 'react'
function MyComponent() {
useLayoutEffect(() => {
function onWindowResize() {}
return () => {}
}, [])
return <div>Hi There</div>
}
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)
}
import React, { useState, useLayoutEffect, useRef } from 'react'
function MyComponent() {
const [windowSize, _setWindowSize] = useState([
window.innerWidth,
window.innerHeight,
])
const windowSizeRef = useRef(windowSize)
const setWindowSize = (value) => {
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,
const [cookies, setCookie] = useCookies(['frbstkn', 'redirect'])
useEffect(() => {
auth.onAuthStateChanged((user) => {
if (user) getCustomToken()
})
}, [])
const getCustomToken = async () => {
if (auth.currentUser === null) return
name: Firestore Backups
on:
workflow_dispatch:
inputs:
name:
description: 'Backup'
default: 'Backup'
required: false
schedule:
- cron: '0 0 1-31/2 * *'