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 / namedtuple_example.py
Created November 29, 2023 06:01
namedtuple example
View namedtuple_example.py
from collections import namedtuple
data = ('Regis', 'Santos', 'regis@email.com')
first_name, last_name, email = data
print(first_name, last_name, email)
Person = namedtuple('Person', ['first_name', 'last_name', 'email'])
person = Person(*data)
print(person.first_name)
@rg3915
rg3915 / class_diagram.mermaid
Last active November 11, 2023 02:38
generate django mermaid diagram
View class_diagram.mermaid
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rg3915
rg3915 / img.png
Last active October 23, 2023 10:02
page TailwindCSS
@rg3915
rg3915 / graphic.js
Created October 20, 2023 07:47
Django and ChartJS load data chartjs 2023 json parse data
View graphic.js
const ctx = document.getElementById('grafico')
const labels = JSON.parse('{{ labels|safe }}')
const data = JSON.parse('{{ data|safe }}')
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
@rg3915
rg3915 / index.html
Last active September 16, 2023 19:34
autocomplete and auto suggestion preenche e completa AlpineJS
View index.html
<!-- https://www.lavivienpost.com/autocomplete-with-trie-code/ -->
<!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">
@rg3915
rg3915 / README.md
Created August 31, 2023 11:52
redirect with LoginRequiredMixin
View README.md
@rg3915
rg3915 / Document.gif
Last active July 29, 2023 17:34
input suggestion text autocomplete AlpineJS suggestion
@rg3915
rg3915 / atable2.gif
Last active September 8, 2023 01:57
table insert row insere linha tabela AlpineJS
@rg3915
rg3915 / choices.py
Created July 25, 2023 19:18
Django Manager QuerySet ativo
View choices.py
from django.db.models import TextChoices
from django.utils.translation import gettext
class TipoPessoaChoice(TextChoices):
F = "F", gettext("Pessoa Fisica")
J = "J", gettext("Pessoa Juridica")
@rg3915
rg3915 / chat.html
Last active July 22, 2023 09:30
chat tailwindCSS
View chat.html
<div class="fixed bottom-4 right-8 border border-gray-200 rounded-lg shadow-md">
<div class="container mx-auto">
<!-- Chat container -->
<div class="container mx-auto">
<!-- Flex container -->
<div class="flex">
<!-- First div -->
<div class="w-1/2 p-4">
<!-- lista de contatos -->
<div class="container mx-auto p-4">