Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Working

Guilherme Dias Redü guiliredu

🚀
Working
View GitHub Profile
View 0_NestJS-Cheatsheet.md

Nest.js Cheatsheet

Nest CLI

  • npm i -g @nestjs/cli

Packages

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

Express.js

Installing

$ npm install express --save

Hello World

// index.js
@guiliredu
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}@cslavoie.com
ServerName {DOMAIN}
ServerAlias www.{DOMAIN}
ServerAlias {USER}.localhost
ServerAlias {USER}.static.cslavoie.com
DocumentRoot {DOC_ROOT}
<Directory {DOC_ROOT}>
@guiliredu
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>
</div>
@push('scripts')
<script src='https://www.google.com/recaptcha/api.js'></script>
@endpush
View CSS-2019.md
@guiliredu
guiliredu / .editorconfig
Created Mar 7, 2019
Editorconfig for PHP PSR-4
View .editorconfig
# EditorConfig is awesome: http://EditorConfig.org
# 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.
[*]
View SolidPrinciples.md

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
guiliredu / 0-Snippets.md
Last active Mar 12, 2020
Docker - Basic Commands / Cheatsheet
View 0-Snippets.md

Docker Snippets

MongoDB

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

MySQL

  • 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
guiliredu / PHPDocExample.php
Last active Aug 23, 2018
Example of a PHP Class with Doc Block annotation
View PHPDocExample.php
<?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 https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md
* @see http://docs.phpdoc.org/guides/docblocks.html#list-of-tags