View index.js
const functions = require('firebase-functions'); | |
const gcs = require('@google-cloud/storage')(); | |
const sharp = require('sharp') | |
const _ = require('lodash'); | |
const path = require('path'); | |
const os = require('os'); | |
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => { | |
const object = event.data; // The Storage object. |
View database.rules.json
"rules": { | |
"items": { | |
"$uid": { | |
".read": "$uid === auth.uid", | |
".write": "$uid === auth.uid" | |
} | |
} | |
} |
View reverse.pipe.ts
<div *ngFor="let item of listObservable | async | reverse"> | |
{{item?.whatever}} | |
</div> |
View reverse.pipe.ts
<div *ngFor="let item of listObservable | async | reverse"> | |
{{item?.whatever}} | |
</div> |
View index.js
const functions = require('firebase-functions') | |
const admin = require('firebase-admin') | |
admin.initializeApp(functions.config().firebase); | |
const stripe = require('stripe')(functions.config().stripe.testkey) | |
exports.stripeCharge = functions.database |
View user.component.ts
import { Component, OnInit } from '@angular/core'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import * as firebase from 'firebase/app'; | |
import { Observable } from 'rxjs/Observable'; | |
@Component({ | |
selector: 'app-user', | |
templateUrl: './user.component.html', | |
styleUrls: ['./user.component.scss'] | |
}) |
View search-ui.component.html
<div id="search-box"> | |
<!-- SearchBox widget will appear here --> | |
</div> | |
<div id="stats"> | |
<!-- stats widget will appear here --> | |
</div> | |
<div id="hits"> | |
<!-- Hits widget will appear here --> | |
</div> | |
<div id="pagination"> |
View index.js
const functions = require('firebase-functions'); | |
const admin = require("firebase-admin"); | |
admin.initializeApp(functions.config().firebase); | |
const algoliasearch = require('algoliasearch'); | |
const algolia = algoliasearch(functions.config().algolia.appid, functions.config().algolia.adminkey); | |
exports.updateIndex = functions.database.ref('/books/{bookId}').onWrite(event => { |
View phone-login.component.html
<div [hidden]="user"> | |
<h1>Sign In with Your Phone Number</h1> | |
<label for="phone">Phone Number</label><br> | |
<input type="text" [(ngModel)]="phoneNumber.country" class="input" placeholder="1" maxlength="2"> | |
<input type="text" [(ngModel)]="phoneNumber.area" class="input" placeholder="949" maxlength="3"> | |
<input type="text" [(ngModel)]="phoneNumber.prefix" class="input" placeholder="555" maxlength="3"> | |
<input type="text" [(ngModel)]="phoneNumber.line" class="input" placeholder="5555" maxlength="4"> |
View search-ui.html
<div *ngFor="let hit of hits | async"> | |
{{hit | json}} | |
</div> |