Skip to content

Instantly share code, notes, and snippets.

View Auwalms's full-sized avatar

Auwal MS Auwalms

View GitHub Profile
@Auwalms
Auwalms / Form-snippet.vue
Last active December 26, 2017 12:01
Signup screen
<template>
<div>
<div is="sui-container">
<sui-grid>
<sui-grid-row>
<sui-grid-column :width="7" class="centered" >
<sui-segment centered class="signup-div">
<sui-image :src="require('./../../assets/dummy-img.png')" size="tiny" shape="circular" class="centered" />
<form is="sui-form" @submit="signupUser">
<div is="sui-form-field">
//add to src/sw.js
importScripts('workbox-sw.dev.v2.0.0.js');
const workboxSW = new self.WorkboxSW();
workboxSW.precache([]);
//create a folder in the project folder and name it 'workbox-cli-config.js'
// then add the below snippet
module.exports = {
@Auwalms
Auwalms / PubSub.js
Created April 1, 2017 09:42
Cloud Function Talks snippets
exports.sendFollowerNotification = functions.database.ref('/followers/{followedUid}/{followerUid}').onWrite(event => {
const followerUid = event.params.followerUid;
const followedUid = event.params.followedUid;
// Get the list of device notification tokens.
const getDeviceTokensPromise = admin.database().ref(`/users/${followedUid}/notificationTokens`).once('value');
//fetch followers information
const getFollowerProfilePromise = admin.auth().getUser(followerUid);
return Promise.all([getDeviceTokensPromise, getFollowerProfilePromise]).then(results => {
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "Andorra", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},