Skip to content

Instantly share code, notes, and snippets.

View alexandervalencia's full-sized avatar
🚂
Choo Choo!

Alexander Valencia alexandervalencia

🚂
Choo Choo!
View GitHub Profile
@alexandervalencia
alexandervalencia / README.md
Created June 6, 2017 22:32 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@vlilloh
vlilloh / index.js
Created November 5, 2018 06:47
[Firebase] Move a collection in Cloud Firestore with a Cloud Function
exports.mv = functions.https.onRequest(request => {
const mv = async (collRefSource, collRefDest) => {
const querySnapshot = await collRefSource.get();
querySnapshot.forEach(async docSnapshot => {
(async () => {
await collRefDest.doc(docSnapshot.id).set(docSnapshot.data());
docSnapshot.ref.delete();
})();
const collRefs = await docSnapshot.ref.getCollections();
for (const collRef of collRefs)