Skip to content

Instantly share code, notes, and snippets.

View gigocabrera's full-sized avatar

Luis Cabrera gigocabrera

View GitHub Profile
@StefanNieuwenhuis
StefanNieuwenhuis / reactiveconf-framework-independent-components-library-with-StencilJS.md
Last active September 23, 2020 12:55
How to build a framework independent component library with StencilJS

How to build a framework independent component library with StencilJS

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf

@jofftiquez
jofftiquez / firebase_copy.js
Last active April 7, 2024 13:29 — forked from katowulf/firebase_copy.js
Firebase realtime database - how to copy or move data to a new path?
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();
@cliffhall
cliffhall / nuke-firebase-db-and-users-referenced-therein.js
Last active September 24, 2018 22:15
Nuke a Firebase Database and All User Accounts Referenced Therein
// NOTE: Accounts that are not represented in your /users node will not be deleted!
// BLOG: There are other approaches, see: http://cliffordhall.com/2017/04/nuke-firebase-db-and-all-users/
"use strict";
// Get credentials and initialize firebase app
console.log("With the power vested in the admin user, lay waste the database and all its users!");
let admin = require("firebase-admin");
let serviceAccount = require([__dirname, "service-account-key.json"].join('/'));
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
@katowulf
katowulf / firebase_copy.js
Last active July 29, 2022 15:58
Move or copy a Firebase path to a new location
function copyFbRecord(oldRef, newRef) {
oldRef.once('value', function(snap) {
newRef.set( snap.value(), function(error) {
if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); }
});
});
}