By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
import { BehaviorSubject, Observable } from 'rxjs'; | |
/** | |
* Observes the specified property and returns a stream that emits all values which are assigned to the property. When subscribing to the | |
* resulting stream it will always first emit the current value of the property, followed by all new values that are assigned to it. | |
* | |
* @param target Object containing the property. | |
* @param key Key of the property that is to be observed. | |
* @returns A stream of all values that are assigned to the specified property, starting with the current value of the property. | |
*/ |
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. |
import { Injectable } from '@angular/core'; | |
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import { Router } from "@angular/router"; | |
import * as firebase from 'firebase'; | |
@Injectable() | |
export class AuthService { |
import { Pipe, PipeTransform } from '@angular/core'; | |
// Epochs | |
const epochs: any = [ | |
['year', 31536000], | |
['month', 2592000], | |
['day', 86400], | |
['hour', 3600], | |
['minute', 60], | |
['second', 1] |
:root { | |
--ease-in-quad: cubic-bezier(.55, .085, .68, .53); | |
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19); | |
--ease-in-quart: cubic-bezier(.895, .03, .685, .22); | |
--ease-in-quint: cubic-bezier(.755, .05, .855, .06); | |
--ease-in-expo: cubic-bezier(.95, .05, .795, .035); | |
--ease-in-circ: cubic-bezier(.6, .04, .98, .335); | |
--ease-out-quad: cubic-bezier(.25, .46, .45, .94); | |
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1); |
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
subscriptionType { name } | |
types { | |
...FullType | |
} | |
directives { |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
Service Worker - offline support for the web
Progressive apps - high-res icon, splash screen, no URL bar, etc.
<!DOCTYPE html> | |
<html> | |
<body> | |
<p>The dog <span id="edit" contenteditable="true">sleeps on</span> the sofa</p> | |
<script type="text/javascript"> | |
var handler = { | |
onBackspace: function() { | |
console.log("backspace"); | |
}, |
<html> | |
<body> | |
<script type="text/javascript" src="//mozilla.github.io/pdf.js/build/pdf.js"></script> | |
<script type="text/javascript"> | |
var url = "https://docs.google.com/document/export?format=pdf&id=1ML11ZyyMpnAr6clIAwWrXD53pQgNR-DppMYwt9XvE6s&token=AC4w5Vg7fSWH1Hq0SgNckx4YCvnGPaScyw%3A1423618416864"; | |
var pages = [], heights = [], width = 0, height = 0, currentPage = 1; | |
var scale = 1.5; | |
function draw() { |