Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View uloga's full-sized avatar
💭
Working on Shoplr

Alan M uloga

💭
Working on Shoplr
View GitHub Profile
@codediodeio
codediodeio / config.js
Last active April 16, 2024 04:46
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@mbove77
mbove77 / optimizeAndCropImage.cloudFunction.js
Created August 21, 2018 18:21
Firebase cloud function to resize and optimize image after upload in cloud storage.
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const spawn = require('child-process-promise').spawn;
const mkdirp = require('mkdirp-promise');
const path = require('path');
const os = require('os');
const fs = require('fs');
// // Create and Deploy Your First Cloud Functions
exports.optimizeImages= functions.storage.object().onFinalize((data) => {
@uloga
uloga / modulr-util.js
Last active October 30, 2020 05:00
Js
(function () {
'use strict';
angular
.module('modulr.utils', [])
.factory('$modUtil', UtilFactory);
/**
@localpcguy
localpcguy / swipeFunc.js
Created November 17, 2011 16:00
Simple Mobile Swipe function to get the swipe direction
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){