This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
require('firebase');| import firebase from 'firebase/app'; | |
| import 'firebase/storage'; | |
| import { Observable } from 'rxjs'; | |
| firebase.initializeApp({ | |
| apiKey: process.env.VUE_APP_API_KEY, | |
| authDomain: process.env.VUE_APP_AUTH_DOMAIN, | |
| databaseURL: process.env.VUE_APP_DATABASE_URL, | |
| projectId: process.env.VUE_APP_PROJECT_ID, | |
| storageBucket: process.env.VUE_APP_STORAGE_BUCKET, |
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |
| const mock = (success, timeout = 1000) => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| if(success) { | |
| resolve(); | |
| } else { | |
| reject({message: 'Error'}); | |
| } | |
| }, timeout); | |
| }); |
| function foo(s) { | |
| let isPalindrome = true; | |
| for(let i in s) { | |
| if(s[i] !== s[(s.length-1)-i]) { | |
| isPalindrome = false; | |
| } | |
| } | |
| return isPalindrome; | |
| } |
This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
require('firebase');This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
import 'firebase';| 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(); |
User Data stored to another HIPAA compliant database.
userPII:{
id123:{
name:'john doe',
address:'...',
etc:'...',
}
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
Upon login the API will provide a jwt token bearer which is on the response headers. Extract the token from the headers.
Sample Token :
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3N1ZXIiOiJhcGkubXlDdXJlLnBoIiwiYXVkaWVuY2UiOiJ3d3cubXlDdXJlLnBoIiwiZW1haWwiOiJqb2ZmdGlxdWV6QGdtYWlsLmNvbSIsImV4cGlyeSI6IjIwMTYtMDItMTZUMDM6NDA6NDUuMTc0WiIsImlhdCI6MTQ1NTU5MDQ0NX0.1tJCtBYyy6DWwnsap_jIp16pzVx1RK8BrxJIXAqrXrE