Skip to content

Instantly share code, notes, and snippets.

View jofftiquez's full-sized avatar
🔥
Building https://easyjoey.com

Joff Tiquez jofftiquez

🔥
Building https://easyjoey.com
View GitHub Profile
@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();
@jofftiquez
jofftiquez / firebase-admin-multi-apps-init-ES6.md
Last active March 12, 2024 01:29
Firebase admin - how to initialise multiple applications in ES6 nodejs.

Firebase Admin Multi App Initialization - ES6

This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.

ES5 version

Using ES6

import 'firebase';
@jofftiquez
jofftiquez / mock-http.js
Last active February 27, 2024 02:23
Mock HTTP request in javascript using promise and timeout.
const mock = (success, timeout = 1000) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
if(success) {
resolve();
} else {
reject({message: 'Error'});
}
}, timeout);
});
@jofftiquez
jofftiquez / github-workflow-guide.md
Last active December 16, 2023 08:28
CI/CD - Github Workflow + Firebase Hosting Guide

Template

Below is a template of GitHub's Workflow Action config file. Workflow is GitHub's CI/CD tool, like CircleCI.

Directory relative to the root of your application - .github/workflows/main.yml.

name: Deploy

on: 
@jofftiquez
jofftiquez / repeating-sticky-header.html
Created January 19, 2023 06:11
Sample of printing with repeating stick header, and repeating footer.
<table>
<!-- Header section -->
<thead style="display: table-header-group;">
<tr>
<td>
<div style="height: 100px; background: rgb(76, 164, 246);">
<h1>Header</h1>
</div>
</td>
</tr>
@jofftiquez
jofftiquez / Printing.md
Last active September 25, 2023 06:23
Printing skeleton for printing documents with repeating header and footer

Printing Guide

Printing documents in HTML can be tricky at times specially when the content is large and if it requires a repeating headers and footers.

Print Skeleton

<table>
  <!-- Header section -->
 
@jofftiquez
jofftiquez / normal-header.html
Created January 19, 2023 06:12
Sample of printing without repeating stick header, and no repeating footer.
<table>
<!-- Header section -->
<thead>
<tr>
<td>
<div style="height: 100px; background: rgb(76, 164, 246);">
<h1>Header</h1>
</div>
</td>
</tr>
@jofftiquez
jofftiquez / social-buttons.html
Created January 9, 2023 09:23
Social Media Buttons
<div>
<style>
.social-btn-content {
background: #0099cc;
width: 40px;
height: 40px;
text-decoration: none;
border-radius: 100%;
}
</style>
@jofftiquez
jofftiquez / firebase-admin-multi-apps-init.md
Last active April 22, 2022 19:29
Firebase admin - how to initialise multiple applications in nodejs.

Firebase Admin Multi App Initialization - ES5

This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.

ES6 version

Using Javascript

require('firebase');