Skip to content

Instantly share code, notes, and snippets.

View jpntex's full-sized avatar
🚀
Indielayer

João Teixeira jpntex

🚀
Indielayer
View GitHub Profile
@jpntex
jpntex / auth.js
Created October 2, 2019 12:35
Medium - Firebase Auth Middleware on Cloud Functions
const admin = require('firebase-admin')
const { auth } = admin
module.exports = () => async (req, res, next) => {
// initialize the firebase application
admin.initializeApp()
try {
// retrieve the authorization header
const { authorization } = req.headers
const functions = require('firebase-functions')
const fs = require('fs')
let config = functions.config().env
if (process.env.NODE_ENV !== 'production') {
if (fs.existsSync('./env.json')) {
const env = require('./env.json')
config = env

Keybase proof

I hereby claim:

  • I am jpntex on github.
  • I am joaoteixeira (https://keybase.io/joaoteixeira) on keybase.
  • I have a public key ASD_p11Cecn6278244W6kI39OOq3cw06sKZOHgxRNvY35Qo

To claim this, I am signing this object:

@jpntex
jpntex / index.js
Last active August 29, 2015 14:04
Scroll bullets indicators for Titanium Alloy scrollableView
// Import Libraries
var scrollBullets = require('ui/scrollBullets');
// Build View
var bulletsView = scrollBullets($.scrollViewId);
$.index.add(bulletsView);