Skip to content

Instantly share code, notes, and snippets.

View MarceloHoffmeister's full-sized avatar
👨‍💻
light attracts more bugs

Marcelo Hoffmeister MarceloHoffmeister

👨‍💻
light attracts more bugs
View GitHub Profile
@MarceloHoffmeister
MarceloHoffmeister / settings.json
Last active February 25, 2021 23:42 — forked from diego3g/settings.json
JSON de configuração do VSCode
/**
extensões: GitLens, Vetur, ESLint, Prettier, Omni ou Dracula, Material Icon Theme,
StandardJS, Fonte Victor Mono, Rainbown Brackets Colorizer
*/
{
"editor.lineHeight": 24,
"editor.fontFamily": "Victor Mono",
"editor.fontLigatures": true,
"explorer.compactFolders": false,
// Aplica linhas verticais
@MarceloHoffmeister
MarceloHoffmeister / post-receive.sh
Last active April 3, 2020 17:52
Script para deploy usando Git
#!/bin/bash
# script baseado no Codecasts para deploy pelo Git
# https://github.com/codecasts/server-templates/blob/master/post-receive
while read oldrev newrev ref
# Variables
USER_PATH='/home/user'
REPO_PATH=$USER_PATH"/repo"
@MarceloHoffmeister
MarceloHoffmeister / reset-server.sh
Created April 3, 2020 17:51
Script para clone de repositório do GitHub e configuração do servidor
#!/bin/bash
#################################
# #
# Configs #
# #
#################################
DEV_NAME=
GITHUB_USERNAME=
{
"Jest test": {
"prefix": "test",
"body": [
"describe('', () => {",
" test('', () => {",
" $0",
" })",
"})",
""
@MarceloHoffmeister
MarceloHoffmeister / config-linux.sh
Last active September 17, 2021 12:53
Configuração de máquinas Linux ubuntu-based
# Desktop updating
sudo apt update && sudo apt upgrade -y
# PostgreSQL
sudo apt-get install postgresql
# PGAdmin
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4
@MarceloHoffmeister
MarceloHoffmeister / README.md
Last active September 11, 2020 18:52 — forked from Alymosul/README.md
[Laravel] Seeding data in testing as part of the application build | Semeando dados em testes como parte da construção do aplicativo

A trait SeedDatabase junto com a classe SeedDatabaseState dá ao seu projeto Laravel a habilidade de fazer a seed do banco de dados antes de rodar as test suites, o que melhora a velocidade e tona-se melhor do que executar as seeds do banco de dados antes de cada teste.

Além disso, tem a opção de executar seeds personalizadas em vez dos seeds que são chamados no método run() da classe DatabaseSeeder. Você pode conseguir isso da seguinte forma:

SeedDatabase trait along with SeedDatabaseState class gives your Laravel project the ability to seed the testing database once before running the full suite tests, which improves the speed of the tests than seeding the testing database before each test.

Also, it has the option to run custom seeders instead of the seeders that are called in the run() method of the DatabaseSeeder class you can achieve that as follows:

Testcase.php

@MarceloHoffmeister
MarceloHoffmeister / .eslintrc.json
Created November 2, 2020 10:36
JSON de configuração do ESLint
{
"env": {
"es6": true,
"node": true,
"jest": true
},
"extends": [
"standard",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
@MarceloHoffmeister
MarceloHoffmeister / latin-iso_db_config
Last active January 27, 2021 05:57
Configure Linux OS with LATIN1 encode on Postgres
// add support to desire language/locale
sudo echo "pt_BR.ISO-8859-1 ISO-8859-1" >> /var/lib/locales/supported.d/local
// recompile locales to add support for OS
sudo dpkg-reconfigure locales
// before create DB, restart Postgres service
sudo service postgresql restart
// login in your postgres client
@MarceloHoffmeister
MarceloHoffmeister / Response.php
Created December 4, 2020 14:28 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
<TaskOptions>
<TaskOptions>
<option name="arguments" value="fix -v --config .php_cs.dist --path-mode=intersection -- $FilePath$" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="php" />
<option name="immediateSync" value="false" />
<option name="name" value="PHP CS Fixer" />
<option name="output" value="" />