Skip to content

Instantly share code, notes, and snippets.


Guilherme Dias Redü guiliredu

View GitHub Profile

Nest.js Cheatsheet

Nest CLI

  • npm i -g @nestjs/cli


  • yarn add class-validator class-transformer
  • yarn add @nestjs/mapped-types
guiliredu /
Last active Mar 13, 2020
Express - Node Backend Studies



$ npm install express --save

Hello World

// index.js
guiliredu / apache-template
Created Sep 25, 2019 — forked from lavoiesl/apache-template
Apache VirtualHost Template with variable replacement
View apache-template
<VirtualHost *:80>
ServerAdmin {USER}
ServerName {DOMAIN}
ServerAlias www.{DOMAIN}
ServerAlias {USER}.localhost
ServerAlias {USER}
DocumentRoot {DOC_ROOT}
<Directory {DOC_ROOT}>
guiliredu / 1-input-recaptcha.blade.php
Created Jun 27, 2019
Laravel recaptcha blade component
View 1-input-recaptcha.blade.php
<div class="input-captcha">
<div class="g-recaptcha" data-sitekey="{{ config('app.recaptcha_key') }}"></div>
<script src=''></script>
guiliredu / .editorconfig
Created Mar 7, 2019
Editorconfig for PHP PSR-4
View .editorconfig
# EditorConfig is awesome:
# top-most EditorConfig file
root = true
# All PHP files MUST use the Unix LF (linefeed) line ending.
# Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
# All PHP files MUST end with a single blank line.
# There MUST NOT be trailing whitespace at the end of non-blank lines.

Solid Principles

Single Responsibility Principle

A class should have only one job.

Open-Closed Principle

Software entities (Classes, modules, functions) should be open for extension, not modification.

guiliredu /
Last active Mar 12, 2020
Docker - Basic Commands / Cheatsheet

Docker Snippets


  • Running: docker run -d -p 27017-27019:27017-27019 --name mongodb mongo:4.0.4
  • Bash: docker exec -it mongodb bash


  • Running: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=true -p 3306:3306 -v ~/Projects/Docker/mysql:/var/lib/mysql --name mysql mysql:5.7
guiliredu / PHPDocExample.php
Last active Aug 23, 2018
Example of a PHP Class with Doc Block annotation
View PHPDocExample.php
* This class acts as an example on where to position a DocBlock.
* A blank line must be place after each paragraph. A title and a description
* can be add. Multiple paragraph descriptions can be used.
* @see
* @see