Skip to content

Instantly share code, notes, and snippets.

View AllanCapistrano's full-sized avatar
👾
Playing or watching anime

Allan Capistrano AllanCapistrano

👾
Playing or watching anime
View GitHub Profile
@bmaupin
bmaupin / free-database-hosting.md
Last active November 18, 2024 16:54
Free database hosting
@fernandovaller
fernandovaller / js-mask-cpf-cnpj.js
Created December 5, 2018 20:53
Mascara para CPF e CNPJ em JS
function cnpj(v){
v=v.replace(/\D/g,"") //Remove tudo o que não é dígito
v=v.replace(/^(\d{2})(\d)/,"$1.$2") //Coloca ponto entre o segundo e o terceiro dígitos
v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3") //Coloca ponto entre o quinto e o sexto dígitos
v=v.replace(/\.(\d{3})(\d)/,".$1/$2") //Coloca uma barra entre o oitavo e o nono dígitos
v=v.replace(/(\d{4})(\d)/,"$1-$2") //Coloca um hífen depois do bloco de quatro dígitos
return v
}
function cpf(v){
@aescalana
aescalana / manageFlaskSession.py
Last active October 21, 2024 13:43
Decode and Encode Flask's session cookie. Great for testing purposes; only the secret key is needed
#!/usr/bin/env python
from flask.sessions import SecureCookieSessionInterface
from itsdangerous import URLSafeTimedSerializer
class SimpleSecureCookieSessionInterface(SecureCookieSessionInterface):
# Override method
# Take secret_key instead of an instance of a Flask app
def get_signing_serializer(self, secret_key):
if not secret_key:
return None
@dedunumax
dedunumax / .gitignore Java
Last active October 24, 2024 04:44
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*