Skip to content

Instantly share code, notes, and snippets.

View kelwys's full-sized avatar
🚀
Boosting myself

Kelwy Oliveira kelwys

🚀
Boosting myself
View GitHub Profile
@kelwys
kelwys / ant-checkbox-group.js
Last active January 10, 2022 18:29
Ant Checkbox.Group from an array with grid and complex layout
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import './index.css';
import { Checkbox, Row, Col } from 'antd';
function onChange(checkedValues) {
console.log('checked = ', checkedValues);
}
@kelwys
kelwys / .zshrc
Last active March 27, 2021 17:01
My zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/kelwy/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@kelwys
kelwys / hyper.js
Last active March 27, 2021 16:12
My hyper terminal
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
activeTab: '🚀',
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@kelwys
kelwys / serializer_choicefield_display.py
Created July 21, 2020 14:00
how serializer choicefield
class UserSerializer(serializers.ModelSerializer):
gender = serializers.SerializerMethodField()
class Meta:
model = User
def get_gender(self,obj):
return obj.get_gender_display()
# for the latest DRF (3.6.3) - easiest method is:
@kelwys
kelwys / docker.md
Last active March 17, 2020 02:23
docker_snaps

Basico de Docker

O que são Containers

"Um container é um padrão de unidade de software que empacota código e todas as dependências de uma aplicação fazendo que a mesma seja executada rapidamente de forma confiável de um ambiente computacional para o outro." docker.com

Evitar:

  1. Na minha máquina funciona!
  2. Garantir o mesmo ambiente para todos
@kelwys
kelwys / actions.py
Last active June 10, 2024 07:31
Export Django Admin to Excel with Action
from openpyxl import Workbook
from django.http import HttpResponse
from datetime import datetime, date
from .export_excel import ExportExcelAction
from openpyxl.styles import Font
from unidecode import unidecode
def style_output_file(file):
black_font = Font(color='000000', bold=True)