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 Firebase = require("./firebase.init"); | |
const returnTotal = (UID, res) => { | |
const date = new Date(); | |
const month = date.getMonth(); | |
Firebase.FireDB.ref(UID) | |
.once("value") | |
.then(snapshot => { | |
const user = snapshot.val() || "undefined"; | |
if (user !== "undefined") { |
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 Firebase = require("./firebase.init"); | |
const addExpense = (request, res) => { | |
const body = request.body; | |
const UID = body["messenger user id"]; | |
const ref = Firebase.FireDB.ref(UID); | |
ref.once("value").then(snapshot => { | |
const user = snapshot.val() || "undefined"; | |
if (user !== "undefined") { | |
const date = new Date(); |
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 Firebase = require("./firebase.init"); | |
const checkUser = (UID, res) => { | |
Firebase.FireDB.ref(UID) | |
.once("value") | |
.then(snapshot => { | |
const user = snapshot.val() || "undefined"; | |
if (user !== "undefined") { | |
res.send({ redirect_to_blocks: ["offre"] }); | |
} else { |
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 express = require("express"); | |
const bodyParser = require("body-parser"); | |
const request = require("request"); | |
const path = require("path"); | |
const PORT = process.env.PORT || 5000; | |
const Firebase = require("./lib/firebase.init"); | |
const expense = require("./lib/expense"); | |
const user = require('./lib/checkUser'); | |
const total = require('./lib/total'); | |
const day = require('./lib/setDay'); |
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
git checkout master | |
git pull origin master | |
git checkout <branch> | |
git merge master |
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
export interface Worker { | |
firstName: string; | |
interest: string; | |
additionalInterests: string[]; | |
city: string; | |
age: number; | |
lastName: string; | |
phone: string; | |
experiences: Experience[]; | |
entryDate: string; |
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 { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Convert bytes into largest possible unit. | |
* Takes an precision argument that defaults to 2. | |
* Usage: | |
* bytes | fileSize:precision | |
* Example: | |
* {{ 1024 | fileSize}} | |
* formats to: 1 KB |
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
<my-component [myBooleanValue]="someValue"></my-component> |
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
// set up some class with an input decorator (the one we want to watch and act upon change | |
export class MyComponent { | |
myBooleanValue: boolean; | |
@Input() | |
set myBooleanValue(newValue: boolean) { | |
// will display this message as soon as the value of 'myBooleanValue' changes | |
console.log(`old value was ${this.booleanValue}, new value is ${newValue}`; | |
this.myBooleanValue = newValue; |
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
goToServer = () => { | |
this.http.get('url'); | |
} | |
getInformtionFromService = () => { | |
service.goToServer().subscribe(result => console.log(result), error => console.log(error.message)) | |
} |