Skip to content

Instantly share code, notes, and snippets.

View vndmtrx's full-sized avatar
💅
Fazendo vários nadas

Eduardo N.S.R. vndmtrx

💅
Fazendo vários nadas
View GitHub Profile
@vndmtrx
vndmtrx / avl.py
Last active January 1, 2024 05:10
Implementação de árvores AVL
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Árvore AVL em Python
Copyright (c) 2009 Vindemiatrix Almuredin.
É dada permissão para copiar, distribuir e/ou modificar este documento
sob os termos da Licença de Documentação FAIL,
Versão 97.545.668.112.666.002 Build 69 Release 42;
Uma cópia da licença talvez esteja inclusa na seção entitulada
@vndmtrx
vndmtrx / subnet.py
Last active October 18, 2023 20:09
Python 3 simple subnet calculator
#!/usr/bin/env python3
# Use: ./subnet.py <ip/cidr>
# Alt: ./subnet.py <ip> <mask>
import sys
if __name__=="__main__":
addr = [0, 0, 0, 0]
mask = [0, 0, 0, 0]
cidr = 0
@vndmtrx
vndmtrx / serialwin.vbs
Last active September 25, 2023 21:38
Função VBS para salvar a chave de ativação atualmente em uso no Windows 7, 8, 8.1 e 10.
Option Explicit
'Código VBS para salvar a chave do Sistema para Windows 10, 8 e 7.
'Adaptado do site: http://winaero.com/blog/how-to-view-your-product-key-in-windows-10-windows-8-and-windows-7/
Dim objshell, Caminho, ChaveDigitalProduto, Result
Set objshell = CreateObject("WScript.Shell")
'Registra o path do registro onde está a chave do sistema
Caminho = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Chave de registro do sistema
@vndmtrx
vndmtrx / content-use-license-nuvemlgbt-en.md
Last active June 20, 2023 14:03
Licença de Uso dos Conteúdos da NuvemLGBT / NuvemLGBT Content Use License

NuvemLGBT Content Use License

This license establishes the terms and conditions for the use of user-generated content on the NuvemLGBT platform. By using the NuvemLGBT platform, you agree to adhere to the terms stipulated in this license.

1. Definitions

  1. "NuvemLGBT", hereinafter referred to as INSTANCE, refers to the online platform, based on Mastodon, intended for the creation and sharing of content related to the members of this INSTANCE.

  2. "User" refers to any person who has access and uses the services of INSTANCE.

  3. "Content" refers to any and all material, such as texts, images, videos, audios and any other forms of expression created and made available by the user in INSTANCE.

@vndmtrx
vndmtrx / toot-in-pride-nuvemlgbt.css
Created June 2, 2023 17:40
Toot in Pride da instância Mastodon NuvemLGBT
.compose-form__publish-button-wrapper button,
.ui__header__links .button {
background-color: rgba(0, 0, 0, 0);
background-image: linear-gradient(
#E22016,
#F28917,
#EFE524,
#78B82A,
#2C58A4,
#6D2380,
@vndmtrx
vndmtrx / twitter-unfav.js
Last active October 12, 2021 04:50
Js snippet for unfav tweets
/* Snippet for unfav tweets *
* 1: Access your favs tab on https://twitter.com/PROFILE/likes *
* 2: Run this snippet on Developer Tools > Console *
* 3: Wait a rather long time to script unfav all your tweets */
var timeout = 2000;
var promise = Promise.resolve();
var loop = setInterval(clearFavs, 10000);
function clearFavs() {
clearInterval(loop);
/* ~/.config/gtk-3.0/gtk.css */
/* Lista plugins: xfconf-query -c xfce4-panel -p /plugins -lv */
/* Recarrega XFCE: xfce4-panel -r */
/* GTK Theming para o XFCE: https://docs.xfce.org/xfce/xfce4-panel/theming */
/* Tema para uso com o painel horizontal configurado para 48px de tamanho da linha */
#whiskermenu-button* {
-gtk-icon-transform: scale(0.50);
}
@vndmtrx
vndmtrx / Makefile
Created November 30, 2020 16:53
My Makefile for bootstrapping Python projects
SHELL := /bin/bash
.SHELLFLAGS = -e -c
.ONESHELL:
.PHONY: clean freeze
PRJ_NAME = Project Name
.venv: .venv/bin/activate
@vndmtrx
vndmtrx / caminho_transito.py
Last active August 19, 2020 18:00
Algoritmo para calcular a existência de caminhos em cruzamento.
grafo = {
'0': ['6'],
'1': ['2', '6'],
'2': ['1', '3', '7'],
'3': ['2'],
'4': ['3', '5'],
'5': ['4', '10'],
'6': ['0', '1', '7'],
'7': ['6', '12', '13'],
'8': ['3', '7', '9', '13'],
@vndmtrx
vndmtrx / cron_script.sh
Last active November 12, 2018 11:27
Script para execução de atividades no Cron, com controle de horas e bloqueio de múltiplas execuções. Rode com cron_script.sh <path da atividade>.
#!/usr/bin/env bash
## Script Modelo de execução de tarefas no cron
## Recomendação: Usar script na pasta /etc/cron.d/ em vez de usar cron de usuário (crontab -e)
## Recomendação: Usar rotação de logs (https://www.thegeekstuff.com/2010/07/logrotate-examples)
##################################################### Configuração ####################################################
#TODO: Criar /etc/logrotate.d/script
if [ $# -ne 1 ]; then