Skip to content

Instantly share code, notes, and snippets.

View dhelbegor's full-sized avatar
🤘
Awesome

Adailton Nascimento dhelbegor

🤘
Awesome
View GitHub Profile
@antoniopresto
antoniopresto / banco_codigo.json
Last active March 25, 2025 06:43
JSON bancos do brasil com código
[
{
"value": "001",
"label": "Banco do Brasil S.A."
},
{
"value": "003",
"label": "Banco da Amazônia S.A."
},
{
@lucascnr
lucascnr / cpf_cnpj_generator.py
Created November 18, 2016 19:36
Gerador de CPF e CNPJ em Python
def generate_cpf(self):
cpf = [random.randint(0, 9) for x in range(9)]
for _ in range(2):
val = sum([(len(cpf) + 1 - i) * v for i, v in enumerate(cpf)]) % 11
cpf.append(11 - val if val > 1 else 0)
return '%s%s%s.%s%s%s.%s%s%s-%s%s' % tuple(cpf)
@danni
danni / fields.py
Created March 8, 2016 08:52
Multi Choice Django Array Field
from django import forms
from django.contrib.postgres.fields import ArrayField
class ChoiceArrayField(ArrayField):
"""
A field that allows us to store an array of choices.
Uses Django 1.9's postgres ArrayField
and a MultipleChoiceField for its formfield.
@rg3915
rg3915 / boilerplate2.sh
Last active February 17, 2023 11:53
Boilerplate: Shell script to create a complete Django project in Mac with Python 3.7 and Django 2.2.12
# Shell script to create a complete Django project.
# This script require Python 3.x and pyenv
# Settings.py is config to Django 2.2.12
# The project contains:
# Settings config
# Person model and form
# Person list and detail
# Person create, update and delete
# Admin config
@hofmannsven
hofmannsven / README.md
Last active April 30, 2025 15:25
Git CLI Cheatsheet
@tsabat
tsabat / zsh.md
Last active April 21, 2025 07:22
Getting oh-my-zsh to work in Ubuntu