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 availableProducts = products.filter(product => ( | |
| (product && product.quantity !== 0) && | |
| (product && product.metadata && !product.metadata.isIllegal) && | |
| (product && product.metadata && product.metadata.status && product.metadata.status === 'good') | |
| )); | |
| const damagedProducts = products.filter(product => ( | |
| (product && product.quantity !== 0) && | |
| (product && product.metadata && !product.metadata.isIllegal) && |
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 availableProducts = products.filter(product => ( | |
| (product && product.quantity !== 0) && | |
| (product && product.metadata && product.metadata.status && product.metadata.status === 'good') | |
| )); | |
| const damagedProducts = products.filter(product => ( | |
| (product && product.quantity !== 0) && | |
| (product && product.metadata && product.metadata.status && product.metadata.status === 'damaged') | |
| )); |
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 availableProducts = products.filter(product => ( | |
| (product.quantity !== 0) && | |
| (product.metadata.status === 'good') | |
| )); | |
| const damagedProducts = products.filter(product => ( | |
| (product.quantity !== 0) && | |
| (product.metadata.status === 'damaged') | |
| )); |
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 express from 'express'; | |
| import SSE from 'sse'; | |
| let app = express(); | |
| app.use('/', (req, res) => { | |
| res.status(200).send(''); | |
| }); | |
| app.listen(3000, (err) => { | |
| if(err) throw err; |
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
| var Rx = require('rx'); | |
| // buat sumber datangnya event | |
| var button = document.querySelector('.myButton'); | |
| // buat observable (dari sumber event yakny 'click' event dari element button) | |
| var buttonObservable = Rx.Observable.fromEvent(button, 'click'); | |
| // buat observer | |
| var subscription = buttonObservable | |
| .map(function(event) { | |
| return "Saya di klik!" |
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
| // read directory source path | |
| function bacaDirektori(source) { | |
| return new Promise(function (resolve, reject) { | |
| fs.readdir(source, function (err, files) { | |
| if(err) reject(err) | |
| else resolve(files) | |
| }) | |
| }) | |
| } |
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
| fs.readdir(source, function (err, files) { | |
| if (err) { | |
| console.log('Error finding files: ' + err) | |
| } else { | |
| files.forEach(function (filename, fileIndex) { | |
| console.log(filename) | |
| gm(source + filename).size(function (err, values) { | |
| if (err) { | |
| console.log('Error identifying file size: ' + err) | |
| } 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
| // read directory source path | |
| fs.readdir(source, function (err, files) { | |
| if (err) { | |
| console.log('Error finding files: ' + err) | |
| } else { | |
| console.log('Kita dapat filesnya!', files) | |
| } | |
| }) |
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
| package com.company; | |
| /** | |
| * Created by donnystark on 11/19/15. | |
| */ | |
| public class QueuePriority { | |
| DLL Front, Rear; | |
| int size = 0; | |
| private DLL temp; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Page not found</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <style type="text/css"> | |
| body { | |
| font-family: 'Avenir' ,'Segoe UI', 'Helvetica Neue', Helvetica, Arial; | |
| } |