This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
import 'firebase';This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
import 'firebase';| 'use strict'; | |
| const chromeLauncher = require('chrome-launcher'); | |
| const CDP = require('chrome-remote-interface'); | |
| const launchChrome = () => | |
| chromeLauncher.launch({ | |
| chromeFlags: ['--disable-gpu', '--headless'] | |
| }); |
| function copyFbRecord(oldRef, newRef) { | |
| return Promise((resolve, reject) => { | |
| oldRef.once('value').then(snap => { | |
| return newRef.set(snap.val()); | |
| }).then(() => { | |
| console.log('Done!'); | |
| resolve(); | |
| }).catch(err => { | |
| console.log(err.message); | |
| reject(); |
| const reducers = { | |
| add(state, {payload: [number]}) { | |
| return state + number; | |
| }, | |
| }; | |
| function reducer(state, action) { | |
| if (reducers.hasOwnProperty(action.type)) | |
| return reducers[action.type](state, action); | |
| return state; |
| const isWalkable = value => value !== null && typeof value !== 'undefined'; | |
| const getChild = (parent, child) => (isWalkable(parent) ? parent[child] : undefined); | |
| const getIn = (descendants, origin) => descendants.split('.').reduce(getChild, origin); |
| $(window).load(function() { | |
| $('.slides').on('setPosition', function () { | |
| $(this).find('.slick-slide').height('auto'); | |
| var slickTrack = $(this).find('.slick-track'); | |
| var slickTrackHeight = $(slickTrack).height(); | |
| $(this).find('.slick-slide').css('height', slickTrackHeight + 'px'); | |
| }); | |
| }) |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| const route = 'https://jsonplaceholder.typicode.com/posts'; | |
| class AsyncPostHoC extends React.Component{ | |
| constructor(props){ | |
| super(props); | |
| this.state = { | |
| isFetching: true, |
| const UppercaseHoC = (WrappedComponent) => class extends React.Component{ | |
| render(){ | |
| return( | |
| <div style="text-transform: uppercase;"> | |
| <WrappedComponent {...this.props} /> | |
| </div> | |
| ) | |
| } | |
| } |