This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gcs = require("@google-cloud/storage")({ | |
keyFilename: "serviceAccountKey.json" | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bucket = gcs.bucket("bucket-name"); | |
bucket.upload("/tmp/temp.csv", { | |
destination: "csv-folder/file.csv" | |
}, function(err, file) { | |
if (!err) { | |
// done | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
functions-emulator deploy \ | |
--trigger-event=ref.write \ | |
--trigger-provider=google.firebase.database \ | |
--trigger-resource=sources/net-conversion/client-for-test-schema-and-big-query/s-4/schema \ | |
--data='{"message":"Hello World"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, ElementRef, ViewChild, AfterContentInit } from '@angular/core'; | |
@Component({ | |
selector: 'custom-form', | |
template: ` | |
<form> | |
<input | |
placeholder="Name" | |
#nameInput | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, AfterContentInit, Renderer2 } from '@angular/core'; | |
@Component({ | |
selector: 'custom-form', | |
template: ` | |
<form> | |
<input | |
placeholder="Name" | |
id="name-input" | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dinosaurs": { | |
"bruhathkayosaurus" : { | |
"appeared" : -70000000, | |
"height" : 25, | |
"length" : 44, | |
"order" : "saurischia", | |
"vanished" : -70000000, | |
"weight" : 135000 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WORKS | |
// firebase API - with once('value') | |
firebase().database().ref('/dinosaurs').orderByChild('height').once('value', function (snapshot) { | |
snapshot.forEach(function(child) { | |
console.log(child.val()) | |
}); | |
}); | |
// firebase API - with once('child_added') | |
firebase().database().ref('/dinosaurs').orderByChild('height').once('child_added', function (snapshot) { | |
console.log(snapshot.val()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rxjs 5.4 | |
// angularfire2-4.0.0-rc.1 | |
import { Injectable } from '@angular/core'; | |
import { AngularFireDatabase } from 'angularfire2/database'; | |
import 'rxjs/add/observable/combineLatest'; | |
import {Observable} from 'rxjs/Observable'; | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rxjs 5.4, ngrx 4.0.0, angular 4.0.0 | |
import {Injectable} from '@angular/core'; | |
@Injectable() | |
export class Task1Effects { | |
@Effect() task1$: Observable<Action> = this.actions$ | |
.ofType('TASK1') | |
.switchMap((action: Action1) => | |
this.service1.doSomething(action.param1) | |
.map((result) => new Action1Success(result)) |
OlderNewer