Skip to content

Instantly share code, notes, and snippets.

Jefferson jezao

Block or report user

Report or block jezao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jezao
jezao / User.php
Created Aug 14, 2018 — forked from bramnauta/User.php
app/User.php
View User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
@jezao
jezao / ext.txt
Created May 22, 2018 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
View ext.txt
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@jezao
jezao / traduzErroPagseguro.php
Last active Feb 2, 2018
Pagseguro - Lista de erros traduzidos
View traduzErroPagseguro.php
<?php
public function translateError($code)
{
switch($code)
{
case "5003": $err = "Falha de comunicação com a instituição financeira"; break;
case "10000": $err = "Marca de cartão de crédito inválida"; break;
case "10001": $err = "Número do cartão de crédito com comprimento inválido"; break;
case "10002": $err = "Formato da data inválida"; break;
@jezao
jezao / how-to-set-up-stress-free-ssl-on-os-x.md
Created Nov 12, 2017 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine
View how-to-set-up-stress-free-ssl-on-os-x.md

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@jezao
jezao / bancosbrasil.json
Created Apr 10, 2017
Lista de bancos brasil JSON
View bancosbrasil.json
[{"id":1, "code":0, "bank":"Banco de Desenvolvimento do Estado de Santa Catarina S.A.", "featured":0, "active":0},
{"id":2, "code":654, "bank":"Banco A.J.Renner S.A.", "featured":0, "active":1},
{"id":3, "code":246, "bank":"Banco ABC Brasil S.A.", "featured":0, "active":1},
{"id":4, "code":75, "bank":"Banco CR2 S.A.", "featured":0, "active":1},
{"id":5, "code":121, "bank":"Banco Agiplan S.A.", "featured":0, "active":1},
{"id":6, "code":0, "bank":"Banco Alfa de Investimentos S.A.", "featured":0, "active":0},
{"id":7, "code":25, "bank":"Banco Alfa S.A.", "featured":0, "active":1},
{"id":8, "code":641, "bank":"Banco Alvorada S.A.", "featured":0, "active":1},
{"id":9, "code":65, "bank":"Banco Patagon S.A.", "featured":0, "active":1},
{"id":10, "code":213, "bank":"Banco Arbi S.A.", "featured":0, "active":1},
@jezao
jezao / simplehttp.php
Last active Mar 31, 2017
Make a GET/POST request with CURL in PHP
View simplehttp.php
function simplehttp($method,$url,$data = [], $options = [],$headers=[])
{
$method = strtoupper($method);
$url = ( $method == 'GET' && sizeof($data) > 0) ? $url .= "?" . http_build_query($data) : $url;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($method == 'POST') {
curl_setopt($ch, CURLOPT_POST, 1);
@jezao
jezao / cryptographically_secure_random_strings.php
Created Mar 30, 2017 — forked from raveren/cryptographically_secure_random_strings.php
Generate cryptographically secure random strings. Based on Kohana's Text::random() method and this answer:http://stackoverflow.com/a/13733588/179104
View cryptographically_secure_random_strings.php
function random_text( $type = 'alnum', $length = 8 )
{
switch ( $type ) {
case 'alnum':
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'alpha':
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'hexdec':
You can’t perform that action at this time.