Skip to content

Instantly share code, notes, and snippets.

View alan89's full-sized avatar
💭
Everything on its right place

Alan Escobar alan89

💭
Everything on its right place
View GitHub Profile
const admin = require('firebase-admin');
// expects the environment variable GOOGLE_APPLICATION_CREDENTIALS
const serviceAccount = require(process.env.GOOGLE_APPLICATION_CREDENTIALS);
const credential = admin.credential.cert(serviceAccount);
const PROJECT_ID = '<FIREBASE_PROJECT_ID>';
const app = admin.initializeApp({
credential: credential
@alan89
alan89 / index.js
Created December 27, 2019 17:42 — forked from torresalmonte/index.js
Script to delete Storage rulesets using the "firebaserules" REST API
const admin = require('firebase-admin');
const {sleep} = require('sleep');
// asumes the existance of the GOOGLE_APPLICATION_CREDENCIAL env variable
const firebaseApp = admin.initializeApp();
async function getRulesets(projectId, firebaseApp, pageToken) {
pageToken = pageToken || '';
@alan89
alan89 / README.md
Created November 5, 2019 23:51 — forked from mbleigh/README.md

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>