This file contains 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 React from 'react' | |
import ChipInput from 'material-ui-chip-input' | |
class Chip extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
chips: [], | |
limit: 3 | |
} |
This file contains 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 request = require('request') | |
const [comand, path, ...urls] = [...process.argv] | |
const searchs = [] | |
const searchHttp = (url) => new Promise((resolve, reject) => | |
request(url, (err, response, body) => err ? reject(err) : resolve(body))) | |
urls.map((url) => searchs.push(searchHttp(url))) | |
Promise.all(searchs).then((results) => |
This file contains 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 fs = require('fs') | |
let texto = 'Coffee is life!' | |
const escreve = (file, texto) => new Promise((resolve, reject) => fs.writeFile(file, texto, (err) => err ? reject(err) : resolve())) | |
escreve('teste.txt', texto) | |
.then(() => console.log('Deu certo..')) | |
.catch(() => console.log('Deu ruim... TRATAR')) |
This file contains 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
function media(...arguments) { | |
total = arguments.reduce((a,b) => a+b); | |
return total/arguments.length; | |
} | |
console.log(media(12,6,6,3)); |
NewerOlder