Skip to content

Instantly share code, notes, and snippets.

View helderferrari2's full-sized avatar

Hélder Ferrari Harayashiki helderferrari2

View GitHub Profile
@helderferrari2
helderferrari2 / Instalacao laravel.txt
Last active February 6, 2018 13:10
Instalação do PHP 7, Mysql Server, Apache 2, Composer e Laravel para distro Ubuntu/Debian
Atualizar o sistema
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
Instalação do MysqlServer
sudo apt-get install mysql-server
Instalação do Apache2
sudo apt-get install apache2
Instalação do PHP7.0
Referencias
https://blog.pantuza.com/tutoriais/criando-um-servidor-git
O git é uma ferramenta de linha de comandos para fazer controle de versões de código. Existem alguns sites na web, como o Github, que utilizam o git para criar uma serviço de gestão de projetos de código. Se você tem uma empresa, ou um laboratório de universidade e precisa ter um repositório Git remote ao qual uma equipe ou diversos colaboradores precisam enviar código, esse tutorial irá te ajudar a habilitar um servidor Git remoto.
Caso goste de interfaces gráficas, uma alternativa seria configurar o Gitlab em sua empresa ou laboratório. Essa ferramenta é mais amigável e preparada para controlar o projeto com interações mais humanas. Esse tutorial irá habilitar apenas a interação via linha de comando utilizando o utilitário git.
Vamos dividir nosso tutorial em duas partes. A primeira será o nosso servidor. A segunda será o nosso cliente. Essa última se aplica a todos os usuários que desejam fazer uso do serviço.
SERVIDOR
Vamos começar
public function validarCnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14) {
return false;
}
// Lista de CNPJs inválidos
$invalidos = [
#Configure env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
#Controller
@helderferrari2
helderferrari2 / pokedex_evolution_tree.json
Last active October 22, 2020 22:35
This file contains a json with the evolution of all pokemons of the first generation.
[
{
"id": [1, 2, 3],
"evolution_tree": [
{
"id": 1,
"name": "Bulbasaur",
"image": "https://pokeres.bastionbot.org/images/pokemon/1.png"
},
{
root = true
[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
{
"singleQuote": true,
"trailingComma": "es5"
}
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ["airbnb", "prettier", "prettier/react"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
[
[
{
"id": 1,
"slug": "acrelandia",
"city": "Acrelândia",
"state": "Acre",
"uf": "AC"
},
{
@helderferrari2
helderferrari2 / show git branch with colours in bash
Last active December 6, 2021 12:49
Ubuntu: how do I show the git branch with colours in bash prompt
References:
https://askubuntu.com/questions/730754/how-do-i-show-the-git-branch-with-colours-in-bash-prompt
Edit your bashrc file
$ nano ~/.bashrc
Add these lines in your ~/.bashrc file
...