This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.pylint.master] | |
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the | |
# number of processors available to use. | |
# Note: You have to experiment with this number, in noticed that starting too many | |
# jobs can slow down Pylint | |
jobs = 4 | |
# Add files or directories matching the regex patterns to the ignore-list. The | |
# regex matches against paths. | |
ignore-paths = [".*/migrations", "src/config/settings"] | |
# Disable the message, report, category or checker with the given id(s). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from typing import Union | |
class InvalidCNPJ(Exception): | |
pass | |
def clean_cnpj(value: Union[int, str]) -> str: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from dateutil import parser | |
data = json.loads(open('messages.json').read()) | |
for c in data: | |
with open("conversations/" + "-".join(c["participants"]) + ".txt", "w") as f: | |
for m in c["conversation"]: | |
created_at = parser.parse(m["created_at"]).strftime("%Y-%m-%d %H:%M") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all branches that have been merged | |
git branch -r --merged | grep -v origin/master | sed 's/origin\///' | xargs git push origin --delete | |
# Get a list of git branches, ordered by most recent commit | |
git branch -r --sort=committerdate --format="%(refname:short) %(committerdate:short)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
from xmlrpc.client import dumps, loads | |
from requests import session | |
class XMLRPC: | |
def __init__(self, url): | |
self.session = session(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
from array import array | |
A = array('d', range(3000)) | |
n = len(A) | |
max_sum = -sys.maxsize | |
von = bis = 0 | |
add = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local POLLING = 2 | |
local Sand = 'minecraft:sand' | |
local CFSpray = 'IC2:itemFoamSprayer' | |
local Scaffold = 'IC2:blockIronScaffold' | |
local Reinforced = 'IC2:blockAlloy' | |
local function SelectByName(name) | |
for i=1,16 do | |
local detail = turtle.getItemDetail(i) | |
if detail and detail.name == name then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local display = { | |
{1, 0, 0, 0, 0, 0, 0, 0}, | |
{0, 1, 0, 0, 0, 0, 0, 0}, | |
{0, 0, 1, 0, 0, 0, 0, 0}, | |
{0, 0, 0, 1, 0, 0, 0, 0}, | |
{0, 0, 0, 0, 1, 0, 0, 0}, | |
{0, 0, 0, 0, 0, 1, 0, 0}, | |
{0, 0, 0, 0, 0, 0, 1, 0}, | |
{0, 0, 0, 0, 0, 0, 0, 1}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am canassa on github. | |
* I am canassa (https://keybase.io/canassa) on keybase. | |
* I have a public key whose fingerprint is 45B8 8E66 CE7F FB3D E5A2 531B 003D 4D74 F252 5084 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Replaces unittest style asserts (e.g.: self.assertEqual) with py.test style asserts | |
Usage: | |
from lib2to3.refactor import RefactoringTool | |
refactoring_tool = RefactoringTool(['fix_pytest']) | |
refactoring_tool.refactor(['input.py'], write=True) | |
""" |
NewerOlder