Skip to content

Instantly share code, notes, and snippets.

Working from home

Erik Figueiredo erikfig

Working from home
View GitHub Profile
View gist:1d600f6b6c30a2d31355a01e17332d98
const number = 123456999.789;
let numberFormated = new Intl.NumberFormat('pt-BR', { style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits :2}).format(number);
console.log(numberFormated.replace(/\./g, '').replace(',', '.'))
View gist:73c8b21e5ce379fa193ef2f95313c703
const number = 123456.789;
const formatter = new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' });
View gist:704794a6ad9be4dd458b8f122433f07f
// If you choose to use ENV vars to define these values, give this IdP its own env var names
// so you can define different values for each IdP, all starting with 'SAML2_'.$this_idp_env_id
$this_idp_env_id = 'AMBEV';
//This is variable is for simplesaml example only.
// For real IdP, you must set the url values in the 'idp' config to conform to the IdP's real urls.
$idp_host = env('SAML2_'.$this_idp_env_id.'_IDP_HOST', '');
View gist:7a852ca266900f8375412436bfe48782
# rodar os comandos
pecl install xdebug
docker-php-ext-enable xdebug
#adicionar no arquivo a baixo
View auth.js
export function getToken() {
return new Promise((resolve) => resolve('token'))
View gist:d2899b1b24de4b6bc371619ee79ebca8
use ErikFig\CnabWriter\Entities\Header;
use ErikFig\CnabWriter\Entities\Rem\Boleto\BatchTrailer;
use ErikFig\CnabWriter\Entities\Rem\Boleto\Header as BoletoHeader;
use ErikFig\CnabWriter\Entities\Rem\Boleto\SegmentJ;
use ErikFig\CnabWriter\Entities\Rem\Boleto\SegmentJ52;
use ErikFig\CnabWriter\Entities\Trailer;
include __DIR__ . '/vendor/autoload.php';
View gist:121371775e68ada25aaf1ba468ac76d6
$data = scandir(__DIR__);
foreach ($data as $sub) {
if (is_dir(__DIR__ . DIRECTORY_SEPARATOR . $sub)) {
echo $sub . ' is a dir';
if (preg_match('/[0-9]{3}/', $sub)) {
echo ' and is a bank code';
View bitbucket-pipelines.yml
- step:
name: "Deploy"
- apt-get update -y
- apt-get install -y ssh
- echo "Deploying to environment"
- ssh -i ~/.ssh/config usuario@servidor "git --git-dir=/diretorio/do/repositorio/git/bare fetch origin master:master; GIT_WORK_TREE=/aonde/os/arquivos/vao/ficar/no/servidor/ git --git-dir=/diretorio/do/repositorio/git/bare checkout master -f; cd /aonde/os/arquivos/vao/ficar/no/servidor/; composer install; php artisan migrate; npm run prod"
View gist:5dbf2dd365c95d66439e3d21fcaf3e93
* Created by PhpStorm.
* User: honorato
* Date: 09/08/19
* Time: 08:31
namespace Modules\ContasAPagar\Http\Requests;
View gist:97f5c6226a25c38651ace38b6f77deb6
namespace App\Client;
class Client
protected $token;
protected handler()
$client = new Client();