Skip to content

Instantly share code, notes, and snippets.

View MaxMorais's full-sized avatar
🏢
Building TechMax Soluções

Maxwell Morais MaxMorais

🏢
Building TechMax Soluções
View GitHub Profile
import frappe
from frappe.model.document import Document
from frappe.utils.nestedset import NestedSet
from six import string_types
from frappe.utils import getdate, nowdate
status_map = {}
class SugaredDocument(Document):
Usage: [OPTIONS] COMMAND [ARGS]...
Bench manager for Frappe
Options:
--help Show this message and exit.
Commands:
backup backup site
backup-all-sites backup all sites
@MaxMorais
MaxMorais / maskedentry.py
Last active October 24, 2023 12:06
Masked Entry Widget for TkinterFormWidget for Tkinter - Like web2py FormWidget, with label, entry and tooltipTo future, ensure validation.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
# Name: maskedit.py
# Purpose:
#
# Author: Maxwell Morais (max.morais.dmm@gmail.com)
#
# Created: 10/04/2013
@MaxMorais
MaxMorais / br_l10n_br_account_chart_template.json
Created March 20, 2015 09:05
Plano de Contas Referencial Brasileiro para o ERPNext
{
"country_code": "br",
"name": "Plano de Contas Referencial Brasileiro",
"is_active": "No",
"tree": {
"1 - ATIVO": {
"1.01 - CIRCULANTE": {
"1.01.01 - DISPONIBILIDADES": {
"1.01.01.01.00 - Caixa": {
"legder_or_group": "Ledger",

Sete Atitudes para Hackear a Indústria de Software

By Klaus Wuestefeld

1) Torne-se excelente.

Seja realmente bom em alguma coisa. Não fique só choramingando ou querendo progredir às custas dos outros. Não pense q pq vc sentou 4 anos numa faculdade ouvindo um professor falar sobre software q vc sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo

Py nosso

Py nosso, escrito em C

De tipo fortificado seja o vosso __name__

__import__(a nós, o array);

E seja feito assim, todo dict entre {chaves}

from collections import namedtuple
Linha = namedtuple('Linha', ('DAtras'))
novo_conteudo = []
with open('./meu-arquivo.txt') as f:
conteudo = f.readlines()
inicio_encontrado = False
class Maiusculo(object):
""""Classe que converte qualquer coisa, para texto em maiúsculo"""
def __init__(self, valor):
"""__init__ é o inicializador da instância da classe, é ele que associa
os atributos da instância da classe com os argumentos recebidos"""
   
# Definimos um atributo chamado valor no contexto (self), e convertemos o "valor" do argumento valor
# para uma str em maiúscula (upper)
self.valor = str(valor).upper()
<?php defined('SYSPATH') or die('No direct script access.');
/*
BeansBooks
Copyright (C) System76, Inc.
This file is part of BeansBooks.
BeansBooks is free software; you can redistribute it and/or modify
it under the terms of the BeansBooks Public License.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at