Skip to content

Instantly share code, notes, and snippets.

View zabaala's full-sized avatar
🏠
Working from home

Mauricio Rodrigues zabaala

🏠
Working from home
View GitHub Profile
@zabaala
zabaala / Readme.md
Created July 17, 2023 18:52
How to Setup JavaScriptCore on MacOS 13.4 (mid-2023 version)

How to setup JavaScriptCore on MacOS 13.4

1. Install and configure Xcode

# install xcode command line tool
$ xcode-select --install

# Make sure xcode path is properly set
@zabaala
zabaala / SampleDTO.php
Last active November 27, 2022 15:52
How to validate domain DTOs using Laravel Framework avoiding use of FormRequest approaches.
<?php
namespace Core\SomeDomain\Application\DTOs;
use Exception;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class SampleInput implements ValidatesWhenResolved
{
@zabaala
zabaala / DotNotation.php
Created August 11, 2022 13:47 — forked from antonmedv/DotNotation.php
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@zabaala
zabaala / iterm2-solarized.md
Created April 18, 2022 10:04 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@zabaala
zabaala / slim4-routes.php
Last active April 6, 2022 18:38
List Slim 4 registered routes
<?php
// Slim 4.
$routes = $app->getRouteCollector()->getRoutes();
$output = [];
/** Slim\Routing\Route $route */
foreach ($routes as $route) {
$output[] = [
@zabaala
zabaala / php-docker-ext
Last active March 9, 2022 11:12 — forked from hoandang/php-docker-ext
Complete list of available php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
<?php
namespace Doctrine\DBAL\Logging;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\HttpKernel\KernelInterface;
use function microtime;
use function exec;
/**
@zabaala
zabaala / BindDatabaseServiceProvider.php
Last active March 2, 2021 07:50
php artisan db:log <start> <stop>
<?php
namespace App\Commands\Database;
use Illuminate\Support\ServiceProvider;
class BindDatabaseServiceProvider extends ServiceProvider
{
public function boot()
{
@zabaala
zabaala / service-layer-references-for-laravel-projects.md
Last active November 1, 2020 22:57
Referências para livro service layer em projetos laravel
<?php
declare(strict_types=1);
namespace App\Support\Validation;
abstract class Validation
{
/**
* @var array