This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MatchesControllerTest extends TestCase | |
{ | |
protected $user; | |
protected $profile; | |
public function setUp() | |
{ | |
parent::setUp(); | |
DB::beginTransaction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod("cnpj", function (cnpj, element) { | |
cnpj = jQuery.trim(cnpj); | |
// DEIXA APENAS OS NÚMEROS | |
cnpj = cnpj.replace('/', ''); | |
cnpj = cnpj.replace('.', ''); | |
cnpj = cnpj.replace('.', ''); | |
cnpj = cnpj.replace('-', ''); | |
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This will write private.pem and public.pem in the current directory | |
# The default key strenght is 2048 bits | |
# usage: | |
# # ./gen-jwt-rsa-keys.sh mykey | |
# # ls | |
# gen-jwt-rsa-keys.sh mykey-private.key mykey-public.pem | |
# first time you have to give execution permission or use bash and the filename | |
# # chmod +x gen-jwt-rsa-keys.sh | |
KEYNAME=${1:-jwtrsa} |