Skip to content

Instantly share code, notes, and snippets.

View jovanimoura's full-sized avatar

JM jovanimoura

View GitHub Profile
def valida_renavam(num_rnv):
if isinstance(num_rnv, int):
num_rnv = str(num_rnv)
if len(num_rnv) < 11:
num_rnv = "00" + num_rnv[:len(num_rnv)]
reverse_rnv = num_rnv[9::-1]
soma = 0
for n in range(8):
soma += int(reverse_rnv[n])*(n+2)
@bistaray
bistaray / odoo_install.sh
Last active April 15, 2022 02:51
Install Odoo v10 Enterprise (with Bista repositories)
#!/bin/bash
################################################################################
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04
# Author: Yenthe Van Ginneken
# Adjusted: Ray Carnes
# Assumes you already have an Ubuntu user called "odoo" with a home folder
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
# Place this content in it and then make the file executable:
@ryanc-me
ryanc-me / odoo.conf
Last active September 26, 2020 22:51
Sample Odoo/Nginx Config (with dbfilter_from_header support)
# Author: Ryan Cole
# Website: https://ryanc.me
# GitHub: https://github.com/MGinshe
# Usage:
# Place this file in /etc/nginx/sites-enabled/
# Make sure you edit the DOMAIN_HERE and SSL_CERTIFICATE, and DB_FILTER sections
#
# Note: This config file is designed to be used with the Odoo dbfilter_from_header module
# https://apps.openerp.com/apps/modules/9.0/dbfilter_from_header/
<script>
$(document).ready(function(){
$('#meu_formulario').validate({
rules : {
nome : {
required : true,
minlength : 3
},
email : {
required : true,
from unicodedata import normalize
class TextUtil :
"""
Classe com métodos para tratamento de texto
"""
def removerCaracteresEspeciais (self, text) :
"""
Método para remover caracteres especiais do texto
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@thimbl
thimbl / script.sh
Created March 19, 2011 00:43
shell script to create user accounts
#!/bin/bash
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT