View promissinha.js
const fn = ( f, key ) => ( e ) => ( e ) ? f( e ) : f( key )
const getKey = ( database, table, userUID, child ) =>
database.ref( table )
.child( userUID )
.child( child )
.push()
const create = ( userUID, customerObj ) => {
return new Promise( ( resolve, reject ) =>
View whatscolour.js
( () => {
const getChatTitle = () => document.querySelector('h2.chat-title > span').innerText;
const colour = ( WhatsColour ) => {
let contains = WhatsColour.colorList.findIndex( c => c.name === WhatsColour.getChatTitle() );
if(contains > -1){
document.querySelector('div#main').style.backgroundColor = WhatsColour.colorList[contains].color;
}
}
const getPerson = (color) => ( { name: getChatTitle(), color } );
View imap.js
/*
* imap lazily maps an interable.
* @param fn Map function
* @param arrOrIterator Either an array or an iterator
*
* It works by always returning a new iterator so that
* you can chain other imaps without loopin once more
* over the same array!
*
* Since iterables are returned, to start the real mapping
View thermoCLI.js
#!/usr/bin/env node
'use strict';
const program = require('commander');
program
.version('0.1.5')
.usage('[options] <number>')
.option('--c2f', 'convert Celsius to Fahrenheit')
View primeNumberCheck.js
// Eu faria assim porém essa lógica ESTA ERRADA!!!!
const generateSequenceFromOneUntil = ( max ) =>
[ ...Array(max).keys() ].slice(1)
const isLowerThan = ( divisors ) => ( number ) =>
( number > Math.max( ...divisors ) )
const mergeInArray = ( x, y ) => [].concat( x,y )
View caesars-cipher.js
const CYPHER_LIMIT = 78
const A = 65
const Z = 90
const add = ( c ) => ( s ) => s.concat( c )
const getCharCode = String.fromCharCode
const isSpace = ( x ) => ( x === 32 )
const isInRange = ( min, max ) => ( x ) =>
( ( x >= min ) && ( x <= max ) )
View operationsWithMatrixV2.js
const plus = ( a = 0 ) => ( b = 0 ) => a + b
const times = ( a = 1 ) => ( b = 1 ) => a * b
const minus = ( a = 0 ) => ( b = 0 ) => a - b
const division = ( a = 1 ) => ( b = 1 ) => a / b
const getNumByIndex = ( num, index ) => num[index]
const applyFn = ( fn ) => ( x, y ) => fn( x )( y)
const applyVerticalOperation = ( fn) => ( acc, cur) =>
View validacao.js
$(function() {
const medida_el = document.querySelector('#validacao_medida_id_val')
const dimensao_el = document.querySelector('#validacao_dimensao_id_val')
console.log(medida_el)
console.log(dimensao_el)
const changeMedida = (event) => {
View validacao.js
$(function() {
var dimensoes_val, medidas_val;
$('#validacao_medida_id_val').parent().hide();
$('#validacao_dimensao_id_val').parent().hide();
medidas_val = $('#validacao_medida_id_val').html();
dimensoes_val = $('#validacao_dimensao_id_val').html();
console.log("medidas: "+medidas_val);
console.log("dimensoes: "+dimensoes_val);
View desafio05.js
// https://www.hackerrank.com/challenges/s10-basic-statistics
// const input = `10
// 64630 11735 14216 99233 14470 4978 73429 38120 51135 67060`
const input = `2500
19325 74348 68955 98497 26622 32516 97390 64601 64410 10205 5173 25044 23966 60492 71098 13852 27371 40577 74997 42548 95799 26783 51505 25284 49987 99134 33865 25198 24497 19837 53534 44961 93979 76075 57999 93564 71865 90141 5736 54600 58914 72031 78758 30015 21729 57992 35083 33079 6932 96145 73623 55226 18447 15526 41033 46267 52486 64081 3705 51675 97470 64777 31060 90341 55108 77695 16588 64492 21642 56200 48312 5279 15252 20428 57224 38086 19494 57178 49084 37239 32317 68884 98127 79085 77820 2664 37698 84039 63449 63987 20771 3946 862 1311 77463 19216 57974 73012 78016 9412 90919 40744 24322 68755 59072 57407 4026 15452 82125 91125 99024 49150 90465 62477 30556 39943 44421 68568 31056 66870 63203 43521 78523 58464 38319 30682 77207 86684 44876 81896 58623 24624 14808 73395 92533 4398 8767 72743 1999 6507 49353 81676 71188 78019 88429 68