Skip to content

Instantly share code, notes, and snippets.

View helton's full-sized avatar
🏠
Working from home

Helton Carlos de Souza helton

🏠
Working from home
View GitHub Profile
@helton
helton / cookie-clicker.js
Created August 14, 2017 03:59
Automatize the Cookie Clicker Game
@helton
helton / rename-all.sh
Last active August 9, 2017 21:44
Rename multiple files using a <rules.txt> file
#!/bin/sh
eval "$(sed 's/^/mv /g' rules.txt )"
@helton
helton / factorial.js
Created August 5, 2017 01:59
Factorial with String
const factorial = number => {
let f = 1
for (let i = 1; i <= number; i++) {
console.time('elapsed time')
f *= i;
console.log(`${i}! = ${f}`)
console.timeEnd('elapsed time')
if (f === Infinity)
break;
}
@helton
helton / contas-mensais.ejs
Created July 23, 2017 15:26
Full Stack Academy - Aula 02 - Exercício 04
<% include header %>
<h2>Contas Mensais</h2>
<table>
<thead>
<tr>
<th>Descrição</th>
<th>Valor Estimado</th>
<th>Dia do Vencimento</th>
</tr>
@helton
helton / header.ejs
Created July 23, 2017 14:36
Full Stack Academy - Aula 02 - Exercício 03
<!DOCTYPE html>
<html lang="en">
<head>
<title>Meu Dinheiro</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css">
</head>
<body style="margin: 0">
<section class="header">
<img src="/images/meu-dinheiro.png">
@helton
helton / operacoes.ejs
Created July 23, 2017 13:56
Full Stack Academy - Aula 02 - Exercício 02
<% include header %>
<h2>Operações</h2>
<table>
<thead>
<tr>
<th>Descrição</th>
<th>Valor</th>
<th>Sub-total</th>
</tr>
@helton
helton / calculadora.ejs
Created July 23, 2017 13:33
Full Stack Academy - Aula 02 - Exercício 01
<% include header %>
<h2>Calculadora</h2>
<form method="GET">
Valor inicial: <input type="text" name="valorInicial"><br>
Taxa a.m.: <input type="text" name="taxa"><br>
Quantos meses: <input type="text" name="tempo"><br>
<button type="submit">Calcular</button>
</form>
<% if (resultado.calculado) { %>
@helton
helton / exercicio-06.js
Created July 20, 2017 02:48
Full Stack Academy - Aula 01 - Exercicio 06
/*
* [Exercício 6]
* Utilizando o ExpressJS, crie uma rota que some 2 números enviados como
* parâmetros na URL. Exemplo, ao executar no navegador:
* http://localhost:3000/somar?num1=10&num2=30
* deverá ser retornado na tela A soma é: 40.
*/
const express = require('express')
@helton
helton / exercicio-05.js
Created July 20, 2017 02:47
Full Stack Academy - Aula 01 - Exercicio 05
/*
* [Exercício 5 - extra]
*
* Dado a lista de arquivos/diretórios retornada no exercício anterior,
* mostre quais são arquivos.
* (utilize fs.stat(caminho, (err, stat) => stat.isFile()) para isso.)
*/
const fs = require('fs')
@helton
helton / exercicio-04.js
Created July 20, 2017 02:46
Full Stack Academy - Aula 01 - Exercicio 04
/*
* [Exercício 4]
*
* Construa uma função async que utiliza a função readdirPromise com await e
* escreva no console a lista de arquivos/diretórios retornados.
*/
const fs = require('fs')
const readdirPromise = (path) => new Promise((resolve, reject) =>