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 tamanhoDa = (lista) => lista.length | |
const dividir = (x, y, passos = 0, total = 0) => { | |
const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
const listaFinal = lista.filter(n => { | |
total = total + n | |
return total <= x | |
}) |
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 dividir = (x, y, passos = 0, total = 0) => { | |
// const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
// while(total < x) { | |
// total += lista[passos] | |
// passos++ | |
// } | |
// return passos |
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 crieUmaListaDeTamanho = (tam) => ({ | |
ePreenchaCom: (num) => Array(tam).fill(num) | |
}) | |
const somar = (total, num) => total + num | |
const somatorio = (lista) => lista.reduce(somar, 0) | |
const multiplicar = (x, y) => | |
somatorio( | |
crieUmaListaDeTamanho(x).ePreenchaCom(y) |
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
find . -name "node_modules" -type d -prune -print | xargs du -chs |
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 toLower = (str) => str.toLowerCase() | |
const isEqual = (a, b) => a === b | |
const AND = (args) => args.reduce((r, t) => r && t , true) | |
const getTSFromISODate = (date) => new Date(date).getTime() | |
const getISODateFromTS = (date) => new Date(date) | |
const isTSFromISODate = (from, to) => | |
AND([ | |
isEqual(toLower(from), 'iso'), |
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 getRandomNumber = ( size = 4 ) => | |
Math.floor( | |
Math.random() * ( Number( `1e${size}` ) ) | |
); | |
const getPlateNumbers = (n) => Array(4 - n.length).fill('0').join('') + n; | |
const getRandomNumberSequence = ( size = 4 ) => { | |
const n = String(getRandomNumber(size)); | |
return `${(n.length) < 4 ? getPlateNumbers(n) : n}`; |
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 getRandomNumber = ( size = 4 ) => | |
Math.floor( | |
Math.random() * ( Number( `1e${size}` ) ) | |
); | |
const getRandomNumberSequence = ( size = 4 ) => { | |
const n = getRandomNumber(size); | |
return (String(n).length === size) ? n : `0${n}`; | |
}; |
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 getRandomNumberSequence = ( size = 4 ) => | |
Math.floor( | |
Math.random() * ( Number( `1e${size}` ) ) | |
) |
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
{ balance: 0.7345073 } | |
{ | |
listunspent: [ | |
{ | |
txid: 'd72099f701004e266e6bb22138bcdc1e26ed1f4ffd2cd13955b419f986aceb07', | |
vout: 0, | |
address: '2NGMAWK1sFnHbx7WgE6EUzGLwE5FRQtHoyP', | |
label: 'daniel', | |
account: 'daniel', |
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 { Injectable } from '@angular/core'; | |
import { Http, Headers, Response } from '@angular/http'; | |
import { NotificationsService } from 'angular2-notifications'; | |
import { Observable } from 'rxjs/Observable'; | |
import { environment } from 'environments/environment'; | |
import { Router } from '@angular/router'; | |
import { stringify } from 'querystring'; | |
import 'rxjs/add/operator/map'; | |
import 'rxjs/add/operator/catch'; |