Skip to content

Instantly share code, notes, and snippets.

View leocarmo's full-sized avatar
👨‍💻
cooking...

Leonardo Carmo leocarmo

👨‍💻
cooking...
View GitHub Profile
@leocarmo
leocarmo / Dockerfile
Created January 19, 2022 12:28
Production Hyperf Swoole Dockerfile
FROM phpswoole/swoole:4.8-php8.0-alpine
RUN apk --update add --no-cache \
${PHPIZE_DEPS} \
bash
RUN pecl install \
redis
RUN docker-php-ext-install \
@leocarmo
leocarmo / Dockerfile
Created March 8, 2021 14:13
Dockerfile production ready with Alpine, PHP, Kafka, Swoole, Lumen/Laravel
FROM php:8.0.1-cli-alpine3.13
ARG APPLICATION_PATH=/application
ARG CONFIGS_PATH=/docker/php
LABEL maintainer="Leonardo Carmo <leonardo.carmo@br.experian.com>"
# install dependecies
RUN apk add --no-cache \
bash \
<?php
use Swoole\Http\Server;
use Swoole\Coroutine\Channel;
use Swoole\Coroutine\Redis;
$server = new Server('0.0.0.0', 8000);
$chan = new Channel(100);
<?php
$numbers = range(0, 1_000_000);
$test_times = 1_000;
$without_results = [];
$with_results = [];
// Job
function cube($number) {
@leocarmo
leocarmo / InstituicoesBancariasBrasileirasArray.php
Created June 26, 2018 01:44
Instituições Bancárias Brasileiras - Lista de instituições bancárias e seus códigos de identificação FEBRABAN
<?php
$banks = [
'001' => 'BANCO DO BRASIL S.A. (Banco do Brasil)',
'237' => 'BANCO BRADESCO S.A. (Bradesco)',
'341' => 'BANCO ITAU S.A. (Itaú)',
'356' => 'BANCO ABN AMRO REAL S.A. (Real)',
'409' => 'UNIBANCO UNIAO DE BANCOS BRASILEIROS S.A. (Unibanco)',
'041' => 'BANCO DO ESTADO DO RIO GRANDE DO SUL S.A. (Banrisul)',
'104' => 'CAIXA ECONOMICA FEDERAL (Caixa Econômica Federal)',