Skip to content

Instantly share code, notes, and snippets.

View CristalT's full-sized avatar

Marcelo Forclaz CristalT

View GitHub Profile
const heros = [
{ label: 'Batman' },
{ label: 'Iron Man' },
{ label: 'Superman' },
{ label: 'Green Lantern' },
{ label: 'Cat Woman' },
{ label: 'Supergirl' },
{ label: 'Aquaman' }
]
@CristalT
CristalT / fbProductShare.js
Last active May 2, 2018 02:10
Cloud Function for Firebase for achive Share content in Facebook
const functions = require('firebase-functions')
const admin = require('firebase-admin')
admin.initializeApp()
const firestore = admin.firestore()
exports.fbProductShare = functions.https.onRequest((req, res) => {
const params = req.query
const ref = firestore.collection('products').doc(params.id).get()
ref.then(querySnapshot => {
@CristalT
CristalT / FileUploader.vue
Last active October 5, 2023 11:20
File Uploader Component for Vue.js using Firebase Storage
<template>
<div>
<input type="file" multiple accept="image/jpeg" @change="detectFiles($event.target.files)">
<div class="progress-bar" :style="{ width: progressUpload + '%'}">{{ progressUpload }}%</div>
</div>
</template>
<script>
@CristalT
CristalT / arrownav.js
Last active July 6, 2016 00:15
It allows navigate an HTML table by using keyboard arrows
$.fn.arrownav = function(options) {
var settings = $.extend({
focusOnLoad: true
}, options);
var curRow = this.children('tr:first-child'),
r=0;
if(settings.focusOnLoad) {
curRow.focus();
}
this.children('tr').click(function(){