Skip to content

Instantly share code, notes, and snippets.

View andrebalen's full-sized avatar
🎯
Focusing

vulture andrebalen

🎯
Focusing
  • vulture
  • poa
View GitHub Profile
PROMPT &rNOMEPLAYER&W:&K%L&W:&g%h&Ghp&b%m&Bmn&m%v&Mmv&y%g&Ygold&K%Exp&y%Ffome&b%Ssede&W:
@guidanielli
guidanielli / rede_social.py
Last active January 15, 2018 21:28
Rede Social utilizando grafos e orientação a objetos.
import networkx as nx
from datetime import datetime
from dateutil.relativedelta import relativedelta
class Perfil:
"""Classe que cria perfis para a rede social"""
def __init__(self, __id, nome, data_nascimento, empresa):
@smlb
smlb / touchpad.sh
Created July 14, 2017 19:24
nobody cares
#!/usr/bin/env bash
# toggle the touchpad
state=$(awk '/TouchpadOff/ { print $3 }' <(synclient -l))
case "$state" in
0) synclient touchpadoff=1
unclutter -noevents
;;
1) synclient touchpadoff=0
@ricardodantas
ricardodantas / validacao+mascara.js
Last active April 30, 2025 12:45
Máscara e validação de RG, CNPJ, CPF, etc...
// JavaScript Document
// adiciona mascara para rg
// Cada estado têm regras e quantidades diferentes de números no registro. Por isso,
// não há uma maneira confiável de fazer a validação do mesmo.
function MascaraRg(v0,errChar='?'){
const v = v0.toUpperCase().replace(/[^\dX]/g,'');
return (v.length==8 || v.length==9)?
v.replace(/^(\d{1,2})(\d{3})(\d{3})([\dX])$/,'$1.$2.$3-$4'):
(errChar+v0)