Skip to content

Instantly share code, notes, and snippets.

View scorphus's full-sized avatar
Brewing at 🏡 office

Pablo Aguiar scorphus

Brewing at 🏡 office
View GitHub Profile
@maxim
maxim / gh-dl-release
Last active July 4, 2024 00:00
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@derekstavis
derekstavis / cpfvalidate.py
Last active September 24, 2020 20:22
Validação de CPF em Python
def validate_cpf(cpf):
''' Expects a numeric-only CPF string. '''
if len(cpf) < 11:
return False
if cpf in [s * 11 for s in [str(n) for n in range(10)]]:
return False
calc = lambda t: int(t[1]) * (t[0] + 2)
d1 = (sum(map(calc, enumerate(reversed(cpf[:-2])))) * 10) % 11