Skip to content

Instantly share code, notes, and snippets.

View CleitonDeLima's full-sized avatar
🇧🇷
Working from home

Cleiton de Lima CleitonDeLima

🇧🇷
Working from home
View GitHub Profile
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<name>Void Knight</name>
<filterIcon>5</filterIcon>
<filterIconColor>12</filterIconColor>
<description>Generated by LE Tools Filter Wizard</description>
<lastModifiedInVersion>1.0.6</lastModifiedInVersion>
<lootFilterVersion>1</lootFilterVersion>
<rules>
<Rule>
<type>HIDE</type>
<?xml version="1.0" encoding="utf-8"?>
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<name>Shaman - Raio</name>
<filterIcon>7</filterIcon>
<filterIconColor>16</filterIconColor>
<description />
<lastModifiedInVersion>0.9.2.18</lastModifiedInVersion>
<lootFilterVersion>2</lootFilterVersion>
<rules>
<Rule>
@CleitonDeLima
CleitonDeLima / example.py
Last active October 15, 2021 00:59
Exemplo de response com pdf
class EmpresaReportView(BSModalFormView):
template_name = 'report_form.html'
def get_form_class(self):
nameform = self.kwargs['reponame']
if nameform:
self.form_class = eval(nameform)
from django.forms import BaseInlineFormSet, Media
class BaseInlineNestedFormSet(BaseInlineFormSet):
"""
Classe usada para criar formsets aninhados
Example:
class NestedFormSet(BaseInlineNestedFormSet):
nesteds = {
"prefix": FormSet,
@CleitonDeLima
CleitonDeLima / things.txt
Created January 28, 2020 03:09
Install dependencies SO
# install deps
sudo apt install vim zsh tree postgresql redis-server redis curl wget git terminator xmlsec1 make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# pyenv
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
@CleitonDeLima
CleitonDeLima / install-docker.sh
Last active October 15, 2019 13:37 — forked from sethbergman/install-docker.sh
Install Docker CE on Linux Mint 19
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
# use linux mint: sudo add-apt-repository "\ndeb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install docker.io
@CleitonDeLima
CleitonDeLima / django-media-permissions.md
Created March 6, 2019 20:05 — forked from douglasmiranda/django-media-permissions.md
Fix Django Media Folder Permissions

Check your current file/directory permission with:

stat -c "%a" /path/to/dir_or_file

To recursively give directories read&execute privileges:

find /path/to/base/dir -type d -exec chmod 755 {} +
def draw_text(self, text, x, y, text_width=80):
self.canvas.saveState()
text_lines = textwrap.fill(text, text_width).split('\n')
text = self.canvas.beginText(x, y)
for t in text_lines:
text.textLine(t)
self.canvas.drawText(text)
self.canvas.restoreState()
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
def receive():
while True:
try:
msg = client_socket.recv(BUFFSIZE).decode("utf8")
print(msg)
except OSError:
CONSUMER_KEY=
CONSUMER_SECRET=
ACCESS_TOKEN=
ACCESS_SECRET=