Send mails from firebase using nodemailer and firestore
FIREBASE FUNCTIONS CONFIG
https://firebase.google.com/docs/functions/config-env?hl=es-419
Set config
firebase functions:config:set gmail.email='someEmail' gmail.password='somePass'
import {PixelRatio, Platform} from 'react-native'; | |
type fontScales = -3 | -2 | -1 | 0 | 1 | 2 | 3; | |
type iOS_fontScales = '0.823' | '0.882' | '0.941' | '1' | '1.118' | '1.235' | '1.353'; | |
type iOS_fontScalesMap<T> = {[scale in iOS_fontScales]: T}; | |
const fontScale_iOS: iOS_fontScalesMap<number> = { | |
'0.823': -3, | |
'0.882': -2, | |
'0.941': -1, |
export const arrayRemoveObject = (array: Object[] = [], toRemove: Object): Array<Object> => { | |
const tempArray = array.slice(); | |
if (JSON.stringify(tempArray).includes(JSON.stringify(toRemove))) { | |
return JSON.parse( | |
JSON.stringify(tempArray) | |
.replace(JSON.stringify(toRemove), '') | |
.split('},]') | |
.join('}]') | |
.split('",]') |
import React, {useEffect} from 'react'; | |
import {Keyboard} from 'react-native'; | |
const KeyboardListener: React.FC<{ | |
onDidShow: (e: any) => void; | |
onDidHide: (e: any) => void; | |
}> = ({onDidShow, onDidHide}) => { | |
useEffect(() => { | |
if (onDidShow) Keyboard.addListener('keyboardDidShow', onDidShow); | |
if (onDidHide) Keyboard.addListener('keyboardDidHide', onDidHide); |
/* eslint-disable react/no-array-index-key */ | |
import React, {ReactNode} from 'react'; | |
import {SafeAreaView, View} from 'react-native'; | |
import {withTheme} from '../../Elements'; | |
import {baseTheme, darkTheme, PuraMenteTheme} from '../../../styles/base'; | |
import {makeStyles} from '../../Utils/MakeStylesHoc'; | |
interface CTAWithFadingProps { | |
theme: PuraMenteTheme; |
export const stringifyWithCustomDepth = (obj: any, depth = 1): string => { | |
return !obj | |
? JSON.stringify(obj, null, 2) | |
: typeof obj === 'object' | |
? JSON.stringify( | |
JSON.parse( | |
depth < 1 | |
? '"???"' | |
: `{${Object.keys(obj) | |
.map((k) => `"${k}": ${stringifyWithCustomDepth(obj[k], depth - 1)}`) |
https://firebase.google.com/docs/functions/config-env?hl=es-419
firebase functions:config:set gmail.email='someEmail' gmail.password='somePass'
check for updates in mac OS
defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
defaults write com.apple.finder AppleShowAllFiles -bool YES && killall Finder
react-scripts start/build/test
) "start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
const admin = require('firebase-admin'); | |
const fs = require('fs'); | |
const serviceAccount = require('../../../../../../Private/myschool-data_transfer-key.json'); | |
admin.initializeApp({ credential: admin.credential.cert(serviceAccount) }); | |
const schema = require('./schema').schema; | |
const firestore2json = (db, schema, current) => { |
import React, {useState} from 'react'; | |
import {View, ViewProps} from 'react-native'; | |
interface ContainerWithDimensionsProps extends ViewProps { | |
children: ({ | |
width, | |
height, | |
}: { | |
width: number; | |
height: number; |