Skip to content

Instantly share code, notes, and snippets.

View dehsilvadeveloper's full-sized avatar

André Silva dehsilvadeveloper

View GitHub Profile
@dehsilvadeveloper
dehsilvadeveloper / 0_prerequisites.md
Last active April 25, 2025 09:02
Installing Docker on WSL 2 with Ubuntu 22.04

Installing Docker on WSL 2 with Ubuntu 22.04

Instalando Docker em um WSL 2 com Ubuntu 22.04

Prerequisites

Before start the installation process, make sure you meet the following prerequisites:

  • A Windows 10 operating system with WSL 2 support.
  • WSL 2 enabled.
  • Ubuntu 22.04 installed on WSL 2.
@dehsilvadeveloper
dehsilvadeveloper / 1_html_page.md
Last active January 9, 2025 12:01
Simple admin panel page using HTML and CSS (Flexbox, mobile-first approach and responsivity)

Simple admin panel page using HTML and CSS (Flexbox, mobile-first approach and responsivity)

Painel admin simples feito com HTML e CSS (Flexbox, abordagem mobile-first e responsividade)

HTML for admin panel layout with header, footer and left sidebar

Obs: Icons of Font Awesome library/toolkit were also used.

[index.html]

@dehsilvadeveloper
dehsilvadeveloper / 0_playground.md
Last active January 9, 2025 11:56
Redis - Data types (Strings, Hashes, Lists and Sets)

Redis - Estrutura de dados (Strings, Hashes, Lists e Sets)

Redis - Data types (Strings, Hashes, Lists and Sets)

O que vamos ver ?

Nós vamos conversar sobre as seguintes estruturas de dados disponíveis no Redis: string, hash, list and set.

Redis Playground

Se você quiser utilizar uma aplicação online para testar seu código Redis, você pode usar o seguinte link:

@dehsilvadeveloper
dehsilvadeveloper / 1_using_javascript.md
Last active January 9, 2025 12:02
Desestruturando arrays

Desestruturando arrays

Destructuring arrays

Desestruturando usando JAVASCRIPT

Recuperar itens de um array e já atribuir eles a variáveis.

// Array
const colors = ['DC143C', '7FFFD4', 'FFD700'];
@dehsilvadeveloper
dehsilvadeveloper / 1_nvm_commands.md
Last active January 9, 2025 12:08
Useful NVM commands (and how to check Node, NPM and NVM versions)

Useful NVM commands (and how to check Node, NPM and NVM versions)

Comandos úteis do NVM (e como checar as versões do Node, NPM and NVM)

Useful NVM commands

List locally installed versions of Node:

nvm ls or nvm list node

List available remote versions of Node:

@dehsilvadeveloper
dehsilvadeveloper / 1_introduction.md
Last active January 9, 2025 12:11
Including API documentation on Laravel 10 application using package SCRIBE

Including API documentation on Laravel 10 application using package SCRIBE

Incluindo documentação de API numa aplicação Laravel 10 utilizando package Scribe

Introduction

Scribe helps you generate API documentation for humans from your Laravel codebase.

You can learn more about the package here: https://scribe.knuckles.wtf/laravel/

We will see how to implement it.

@dehsilvadeveloper
dehsilvadeveloper / 0_introduction.md
Last active January 9, 2025 12:21
Unit tests for models on Laravel 10 applications with custom TestCase

Unit tests for models on Laravel 10 applications with custom TestCase

Testes unitários para models em aplicações Laravel 10 com TestCase customizado

Introduction

I will show a way to make testing your models a little bit easier using a custom TestCase.

@dehsilvadeveloper
dehsilvadeveloper / 1_Dockerfile
Last active January 9, 2025 12:27
Dockerfile for PHP 8.2. Can be used to build environment for Laravel 10 applications.
# Defining base image
FROM php:8.2-fpm-alpine
# Setting arguments
ARG user=developer
ARG uid=1000
# Steps of this layer:
# - Install system dependencies
# - Install and enable PHP extensions
@dehsilvadeveloper
dehsilvadeveloper / 1_create-user.dto.ts
Last active February 5, 2024 14:45
Unique validator example for NestJS. Inspired on Laravel validation rule "unique:table,column".
// Path: src/modules/user/dtos/create-user.dto.ts
import { IsOptional, IsNotEmpty, MaxLength, MinLength, IsString, IsEmail } from 'class-validator';
import { IsUnique } from '@modules/common/decorators/is-unique.decorator';
export class CreateUserDto {
@IsOptional()
@IsString()
@MinLength(2)
@MaxLength(70)
@dehsilvadeveloper
dehsilvadeveloper / 1_create-character.dto.ts
Last active February 5, 2024 14:43
Exists validator example for NestJS. Inspired on Laravel validation rule "exists:table,column".
// Path: src/modules/character/dtos/create-character.dto.ts
import { IsNotEmpty, MaxLength, MinLength } from 'class-validator';
import { ExistsOnDatabase } from '@modules/common/decorators/exists-on-database.decorator';
export class CreateCharacterDto {
@IsNotEmpty()
@MinLength(2)
@MaxLength(100)
name: string;