Skip to content

Instantly share code, notes, and snippets.

View jeyziel's full-sized avatar

jeyziel gama jeyziel

View GitHub Profile
@jeyziel
jeyziel / multiplicacao.php
Created July 7, 2017 00:34
multiplicacão
<?php
function multiplicacao($multiplicador,$multiplicando,$count)
{
if ($count >= 1 )
{
echo " $multiplicador x $multiplicando = " . $multiplicador * $multiplicando . "<br>";
return $multiplicador * multiplicacao($multiplicador,$multiplicador*$multiplicando,--$count);
}
const produtos = [
{
nome: 'Bicicleta',
preco: 1200.0
},
{
nome: 'Capacete',
preco: 450.0
}
]
const produtos = [
{
id: 1,
preco: 10.0,
qtd: 2
},
{
id: 2,
preco: 10.0,
qtd: 2
const fs = require('fs')
const path = './'
const readdirPromise = (path) => {
return new Promise( ( resolve, reject ) => {
fs.readdir( path, ( err, files) => {
if( err ) {
console.log('ocorreu um erro')
}else {
const fs = require('fs')
const path = './'
const readdirPromise = (path) => {
return new Promise( ( resolve, reject ) => {
fs.readdir( path, ( err, files) => {
if ( err ) {
reject( err )
}else {
const express = require('express')
const app = express()
const port = 3000
app.get('/somar', (req, res) =>{
const sum = parseInt(req.query.num1) + parseInt(req.query.num2)
res.send('A soma é: ' + sum)
})
@jeyziel
jeyziel / divide.js
Created August 24, 2017 21:44
Curso-JavaScript-Super-Sayajin-Nível-1-Módulo-1-exercícios-aula1
const inverse = ( x ) => x *- 1
const add = ( y ) => ( x ) => x + y
const substract = ( y ) => ( x ) => add( inverse( y ) )( x )
const divide = ( y ) => ( x ) => {
let result = 0;
const subX = substract( x )
const add1 = add(1)
@jeyziel
jeyziel / desafio.js
Created September 4, 2017 00:15
Desafio da divisão
const add = ( x ) => ( y ) => x + y
const divide = ( x ) => ( y ) => {
let multiplyfor10 = 0;
const multiply10 = add(10)
const decrement1 = add(-1)
const addFinal = add(0.1)
const decrementY = add(-y)
@jeyziel
jeyziel / pitagoras.js
Created September 4, 2017 00:20
Teorema de pitagoras
const inverse = ( x ) => x *- 1
const add = ( y ) => ( x ) => x + y
const substract = ( y ) => ( x ) => add( inverse( y ) )( x )
const root = ( y ) => ( x ) => Math.pow( x , 1/y)
const squareRoot = root( 2 )
const multiply = ( y ) => ( x ) => {
@jeyziel
jeyziel / exercicio-1-3.js
Last active October 22, 2017 22:35
filtrar apenas os números que sejam resultado de uma raíz quadrada onde o radicando seja maior que 20
const pow = ( y ) => ( x ) => Math.pow( x, y )
const square = pow(2)
const isGreatThan = ( y ) => ( x ) => x > y
const isGreatThan20 = isGreatThan(20)
const RadicandoGreatThan20 = ( value ) => isGreatThan20( square( value ) )
const list = [1,2,3,4,5,6,7,8,9,10]