Skip to content

Instantly share code, notes, and snippets.

View allysonsilva's full-sized avatar
🌎
Working from anywhere

Alyson Silva allysonsilva

🌎
Working from anywhere
View GitHub Profile
@allysonsilva
allysonsilva / native-js-formatter-currency.js
Last active June 28, 2018 14:05
📢 Native JavaScript Currency [NumberFormat]
let formatter = new Intl.NumberFormat('pt-BR', {
style: 'currency',
currency: 'BRL',
currencyDisplay: "symbol",
minimumFractionDigits: 2,
});
formatter.format('123456.90')); // R$ 123.456,90
formatter.format('12.3456.90')); // NaN
formatter.format('12,3456.90')); // NaN
@allysonsilva
allysonsilva / Docker-Commands.md
Last active May 21, 2018 00:11
Docker Commands 😀

Docker Commands

Install

docker run -v $(pwd):/usr/src/app -w /usr/src/app node:9 npm install
@allysonsilva
allysonsilva / Laravel-PHP-Static-Analysis-Tool.sh
Created May 2, 2018 18:42
⚡️🧠 PHP Static Analysis Tool to Laravel
phpcs --standard=PSR2 --colors --error-severity=1 --ignore='*blade.php*,*twig.php*' --tab-width=4 --encoding=utf-8 --extensions=php -d memory_limit=32M -n -s --report=full --report-width=auto app/
phpcbf --standard=PSR2 --colors --error-severity=1 --ignore='*blade.php*,*twig.php*' --tab-width=4 --encoding=utf-8 --extensions=php -d memory_limit=32M -n app/
php-cs-fixer --diff -v --using-cache=no --rules=@PSR2,@Symfony fix app/
phpmd app/ html cleancode,codesize,controversial,design,naming,unusedcode --suffixes php > phpmd.html
phpcpd --no-interaction --progress --min-lines=4 --min-tokens=40 app/
@allysonsilva
allysonsilva / Full-Markdown.md
Last active July 6, 2024 15:35
⚡️ Full Markdown Example

Headers

# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
@allysonsilva
allysonsilva / Laravel-Optimizer.sh
Created April 28, 2018 17:05
Laravel 5 optimization commands
php artisan clear-compiled
php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan view:cache
php artisan route:cache
php artisan optimize
@allysonsilva
allysonsilva / .editorconfig
Created April 27, 2018 23:35
My EditorConfig
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# all files
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
@allysonsilva
allysonsilva / Laravel-Permissions.sh
Created April 27, 2018 01:37
⚡️ Laravel Permissions
## Optional: if you've been playing around with permissions consider resetting all files and directories to the default.
sudo find ./ -type d -exec chmod 755 {} \;
sudo find ./ -type f -exec chmod 644 {} \;
## Give users part of the laravel group the standard RW and RWX permissions for the existing files and folders respectively.
sudo find ./storage -type d -exec chmod 775 {} \;
sudo find ./bootstrap/cache -type d -exec chmod 775 {} \;
sudo find ./storage -type f -exec chmod 664 {} \;
sudo find ./bootstrap/cache -type f -exec chmod 664 {} \;
@allysonsilva
allysonsilva / Examples-PHP-Static-Analysis-Tool.sh
Last active April 26, 2018 13:04
⚡️🧠 Examples PHP Static Analysis Tool
# ##########################
# PHP Coding Standards Fixer
# ##########################
php-cs-fixer fix Controller.php --rules=@PSR2 --dry-run --diff -
php-cs-fixer fix Controller.php --rules=@PSR2 -v
php-cs-fixer fix app/Http/Controllers --dry-run --verbose --diff --using-cache=no
php-cs-fixer --dry-run --diff --using-cache=no --rules=@PSR2,@Symfony fix Controller.php
php-cs-fixer --dry-run --diff --using-cache=no --rules=@PSR2,@Symfony fix Controller.php ResponseController.php
@allysonsilva
allysonsilva / Composer-Global.sh
Created April 26, 2018 12:13
Global installation of PHP tools with Composer
composer global require phpunit/phpunit @stable
composer global require phpunit/dbunit @stable
composer global require "phpunit/php-invoker=~1.1."
composer global require sebastian/phpcpd
composer global require friendsofphp/php-cs-fixer
composer global require "squizlabs/php_codesniffer=*"
composer global require phpmd/phpmd:@stable
composer global require phploc/phploc:@stable
composer global require phpstan/phpstan
@allysonsilva
allysonsilva / Estudo-Arquitetura-DDD.md
Created April 10, 2018 01:38
Estudo em Arquitetura de Software(DDD - Domain-driven design)⚡️⚙️

Estudo Arquitetura DDD (Domain-driven design)

De acordo com o próprio criador, Eric Evans, DDD não é uma tecnologia e nem uma metodologia. DDD é um estilo de arquitetura orientado a objetos, focado em modelar o domínio do negócio e a lógica do domínio com o uso de técnicas, práticas e padrões de projeto.