Skip to content

Instantly share code, notes, and snippets.

View rg3915's full-sized avatar
🏠
Working from home

Regis Santos rg3915

🏠
Working from home
View GitHub Profile
@rg3915
rg3915 / README.md
Last active November 7, 2024 01:47
state machine

Uma máquina de estados é um modelo de design que organiza a lógica de um sistema em "estados" finitos, onde o sistema pode estar em apenas um estado por vez. Cada estado define o comportamento do sistema e permite transições para outros estados, geralmente com condições específicas. As máquinas de estado são usadas para representar fluxos e interações previsíveis, como etapas de um formulário, navegação em uma interface ou processos de login.

Exemplo com AlpineJS

Vamos criar um exemplo em que uma página exibe seções diferentes (<section>) com base em um estado. Vamos supor que temos três seções: Home, Sobre e Contato, e usaremos AlpineJS para controlar a exibição de cada seção com uma máquina de estado simples.

Estrutura HTML + AlpineJS

<div x-data="{ estado: 'home' }">
@rg3915
rg3915 / README.md
Last active October 13, 2024 06:14
SvelteKit + Landpage in PicoCSS + others pages in TailwindCSS

SvelteKit + Landpage in PicoCSS + others pages in TailwindCSS

Create

npm create svelte@latest landpage -y
cd landpage
@rg3915
rg3915 / README.md
Last active October 2, 2024 05:41
Svelte + PicoCSS + Photo Gallery + table
@rg3915
rg3915 / index.html
Created September 16, 2024 06:47 — forked from aaizemberg/index.html
xkcd font
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>xkcd font</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js"></script>
<style>
@font-face {
font-family: xkcd;
@rg3915
rg3915 / index.html
Last active September 13, 2024 14:59
Pagination PicoCSS dark mode
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<link rel="shortcut icon" href="https://www.djangoproject.com/favicon.ico">
<title>Pagination | PicoCSS</title>
<!-- PicoCSS -->
@rg3915
rg3915 / keymap.json
Created July 13, 2024 08:15
Zed Editor keymap
[
{
"context": "Editor",
"bindings": {
"ctrl-shift-enter": "editor::NewlineAbove",
"ctrl-enter": "editor::NewlineBelow"
}
}
]
@rg3915
rg3915 / README.md
Created May 6, 2024 01:18
edit form with disabled field - disabled select form field
@rg3915
rg3915 / README.md
Last active April 19, 2024 01:24
Guia básico de conceitos sobre Django - conceitos django - backend vs frontend

Objetivo

Login com CPF e senha

authenticate

Falta login

django-cpf-cnpj

@rg3915
rg3915 / README.md
Created April 14, 2024 03:08
Digital Ocean Storage
@rg3915
rg3915 / index.html
Created April 6, 2024 19:16
Mask mascara VanillaMasker mask JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<link rel="shortcut icon" href="http://html5-training-in-hyderabad.blogspot.com.br/favicon.ico">
<title>Mask</title>