Use the following commands to add the kubectl autocomplete to zsh:
mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |
In general, you will learn some markdown tricks combined with standard HTML tags. In more details what you will learn:
from novo_financeiro.models import * | |
leilao = 'DIVSC05-17' | |
for nota in Nota.objects.filter(cache_dicionario__contains=leilao): | |
dicionario = nota.dicionario_do_cache() | |
dicionario['taxas'] = 0 | |
nota.cache_dicionario = json.dumps(dicionario, cls=DjangoJSONEncoder) | |
nota.save() |
from leilao.models import LanceProgramado | |
leilao = 'SEOP15-17' | |
lote = 2795 | |
username = 'shirlene' | |
LanceProgramado.objects.filter( | |
lote__numero_do_lote_no_leilao=lote, | |
lote__leilao__nome=leilao, | |
user__username=username).values_list('ativo', flat=True) |
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
import csv | |
import sys | |
import os | |
# example usage: python split.py example.csv 200 | |
# above command would split the `example.csv` into smaller CSV files of 200 rows each (with header included) | |
# if example.csv has 401 rows for instance, this creates 3 files in same directory: | |
# - `example_1.csv` (row 1 - 200) | |
# - `example_2.csv` (row 201 - 400) | |
# - `example_3.csv` (row 401) |