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 / unpack.py
Created January 25, 2024 19:59
unpack dict Python
def unpack_product_info(**kwargs):
"""
Desempacota um dicionário contendo informações sobre um produto em variáveis.
Parâmetros:
- kwargs (dict): Dicionário com chaves 'produto', 'título' e 'preço'.
Retorna:
- Tupla: Variáveis desempacotadas (produto, título, preço).
"""
@rg3915
rg3915 / README.md
Last active January 13, 2024 04:27 — forked from vallahor/README.md
Given a txt file with a tree structure of directories/files generate a sh with necessary commands to generate that file tree

sh from txt contains tree structure of directories and files

How to create sh commands from txt file contains tree structure of directories and files?

This program convert tree structure of directories and files generate a sh with necessary commands to generate that file tree.

He read input.txt and convert to output.sh.

This is result:

@rg3915
rg3915 / README.md
Created January 2, 2024 13:11
Django-seed my fork

pip install git+https://github.com/rg3915/django-seed.git@main

@rg3915
rg3915 / README.md
Last active December 14, 2023 23:25
@rg3915
rg3915 / namedtuple_example.py
Created November 29, 2023 06:01
namedtuple example
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 December 29, 2023 03:04
generate django mermaid diagram
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 / 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