Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jefferson jezao

🏠
Working from home
View GitHub Profile
@jezao
jezao / .php_cs.laravel.php
Created Jan 27, 2021 — forked from laravel-shift/.php_cs.laravel.php
PHP CS Fixer - Laravel Coding Style Ruleset
View .php_cs.laravel.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
@jezao
jezao / reports.txt
Created Nov 27, 2020 — forked from zircote/reports.txt
phpcs report types
View reports.txt
phpcs --standard=tests/build/phpcs.xml --report=summary .
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE ERRORS WARNINGS
--------------------------------------------------------------------------------
/usr/local/zend/apache2/htdocs/project/application/Bootstrap.php 1 4
...2/htdocs/Project/application/controllers/ActivityController.php 3 1
...
@jezao
jezao / hardening.md
Last active Nov 8, 2020
Hardening server
View hardening.md

Hardening Servers

The objective of this manual is to create a security standard in our infrastructure setup. For this guide, we will use the Chef Inspec to run our setup tests + Dev sec hardening framework automated with Ansible

Pre-requirements

Centos 7+ yum -y install ruby ruby-devel make gcc gcc-c++ git curl

@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 Mar 9, 2021
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':