Skip to content

Instantly share code, notes, and snippets.

View wesleysaraujo's full-sized avatar

Wesley Serafim de Araújo wesleysaraujo

View GitHub Profile
@wesleysaraujo
wesleysaraujo / BadCarro.ts
Created April 7, 2022 21:05
Exemplo ruim de uma classe que fere o princípio da responsabilidade única.
export default class BadCarro
{
private _ano: number
private _velocidade: number = 0
private _modelo: string
private _marca: string
private _cor: string
constructor(ano: number, modelo: string, marca: string, cor: string){
this._ano = ano
@wesleysaraujo
wesleysaraujo / Carro.ts
Last active April 7, 2022 21:04
Exemplo de classe Carro no typescript. Esse é um bom exemplo que atende perfeitamente ao princípio da responsabilidade única, pois cada ação está segregado na sua classe especializada.
export default class Carro
{
private _ano: number
private _velocidade: number = 0
private _modelo: string
private _marca: string
private _cor: string
constructor(ano: number, modelo: string, marca: string, cor: string){
this._ano = ano
@wesleysaraujo
wesleysaraujo / lnmp.sh
Last active May 18, 2018 21:25 — forked from wesleyserafim/lnmp.sh
Deploy Stack Lnmp
!#/bin/bash/
sudo apt-get update
echo '### Instalando Web Server Nginx ###'
sudo apt-get install nginx -y
nginx -v
echo '### Instalando Mysql'
sudo apt-get install mysql -y
mysql -v
echo '### Prepearando para instalar a última versão do PHP ###'
sudo add-apt-repository ppa:ondrej/php
@wesleysaraujo
wesleysaraujo / nginx-default-php
Last active May 18, 2018 21:17 — forked from wesleyserafim/nginx-default-php
Configuração do PHP no Nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
client_max_body_size 20M;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
@wesleysaraujo
wesleysaraujo / pre-deploy-stack-lemp.sh
Created May 18, 2018 14:55
Pré Deploy Lnmp Stack
!#/bin/bash
apt-get -y install wget git screen
git clone https://github.com/lj2007331/lnmp.git
cd lnmp && chmod +x install.sh
screen -S lnmp
./install.sh
Q2Fyb2wgZGUgY3VyaWNpY2EsIFBST01Pw4fDg08gMTAwIHJlYWlzIDIxOTY1NjMzOTAw
@wesleysaraujo
wesleysaraujo / trocoNota.js
Created December 8, 2017 19:56
Calcula o troco e retora a menor quantidade de notas possíveis.
const notas = [100, 50, 20, 10, 5, 2, 1]
const calcNotas = (notrasTroco) => {
if (notas.length > 0) {
let calc = 0
notasTroco.forEach((nota, index) => {
calc = calc + (nota.nota * nota.qtd)
})
@wesleysaraujo
wesleysaraujo / nginx.conf
Created November 22, 2017 04:55 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@wesleysaraujo
wesleysaraujo / auth-login-skeletton-Main.vue
Last active September 17, 2017 00:47
Esqueleto inicial Componente Auth/Login
<template>
<div id="auth" class="row-fluid">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title text-center">Bem vindo</h3>
</div>
<div class="panel-body">
<form class="form-signin" method="post">
<div class="form-group">
@wesleysaraujo
wesleysaraujo / index.html
Created September 14, 2017 17:37
index.hml refatorado
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SocialC</title>
</head>