(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| const { hasOwnProperty } = Object.prototype.hasOwnProperty; | |
| /** | |
| * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| */ | |
| function is(x, y) { | |
| // SameValue algorithm | |
| if (x === y) { | |
| // Steps 1-5, 7-10 |
| import mock from 'mock-fs'; | |
| import fs from 'fs'; | |
| import fileHandler from '../utils/fileHandler'; | |
| beforeEach(() => { | |
| // Creates an in-memory file system | |
| mock({ | |
| '/test': { | |
| 'note.md': 'hello world!' | |
| } |
| {"lastUpload":"2018-04-23T09:11:43.377Z","extensionVersion":"v2.9.0"} |
| function fixGpsTrack(gpsTrack) { | |
| // Make sure trackpoints are chronologically sorted by date | |
| // il n'y a pas besoin de réaffecter gpsTrack. | |
| gpsTrack.sort(function (trackpointA, trackpointB) { | |
| return trackpointB.timestamp - trackpointA.timestamp; | |
| }); | |
| // Remove incomplete trackpoints | |
| gpsTrack.filter(function (trackpoint) { | |
| return trackpoint.lat && trackpoint.lon && trackpoint.timestamp; |
| const mongoose = require('mongoose'); | |
| const express = require('express'); | |
| const faker = require('faker'); | |
| var app = express(); | |
| var userSchema = new mongoose.Schema({ | |
| email: { | |
| type: String, | |
| required: true, |
| let http = require('http'); | |
| let url = require('url'); | |
| let port = 3000; | |
| let server = http.createServer((request, response) => { | |
| var page = url.parse(request.url).pathname; | |
| console.log(page); | |
| response.writeHead(200, { | |
| 'Content-Type': 'text/plain' |
| body { | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| div { | |
| background-color: grey; | |
| text-align: center; | |
| width: 50%; | |
| margin: auto; |
| process.stdin.resume() | |
| process.stdin.setEncoding('utf8') | |
| function isANumber(age){ | |
| return !isNaN(age); | |
| } | |
| console.log('Hello ! What\'s your age ? ') | |
| process.stdin.on('data', (age) => { | |
| if (isANumber(age) === true && age <= 99) { |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title></title> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> | |
| <body> |