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 / class_diagram.mermaid
Last active December 29, 2023 03:04
generate django mermaid diagram
Loading
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
img.png
@rg3915
rg3915 / graphic.js
Created October 20, 2023 07:47
Django and ChartJS load data chartjs 2023 json parse data
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 / middleware.py
Last active July 8, 2024 03:04 — forked from marlonmartins2/middleware.py
middleware PermissionRequiredMixin redirect
from django.utils.deprecation import MiddlewareMixin #verificar se já saiu na versão que utiliza do django ou como ficou no update.
class RequestMiddleware(MiddlewareMixin):
"""
The middleware that intercept a request.
:param MiddlewareMixin: the mixin.
:type MiddlewareMixin: MiddlewareMixin
"""
@rg3915
rg3915 / index.html
Last active September 16, 2023 19:34
autocomplete and auto suggestion preenche e completa AlpineJS
<!-- 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
@rg3915
rg3915 / Document.gif
Last active July 29, 2023 17:34
input suggestion text autocomplete AlpineJS suggestion
Document.gif
@rg3915
rg3915 / atable2.gif
Last active September 8, 2023 01:57
table insert row insere linha tabela AlpineJS
atable2.gif
@rg3915
rg3915 / choices.py
Created July 25, 2023 19:18
Django Manager QuerySet ativo
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
<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">