Skip to content

Instantly share code, notes, and snippets.

@mwikala
mwikala / .php-cs-fixer.dist.php
Last active February 20, 2022 00:58
PHP CS Fixer (PSR12) Configuration
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
@mwikala
mwikala / Dockerfile
Created September 18, 2022 23:06
Add wkhtmltopdf to Laravel Sail (Docker) on M1 Macbook
FROM --platform=linux/amd64 ubuntu:20.04
# ... Other commands
# Install dependencies
RUN echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-cache policy libssl1.0-dev \
&& apt-get install -y libssl1.0-dev libfontconfig zlib1g libfreetype6 libxrender1 libxext6 libx11-6 \
&& apt-get -y autoremove \
@mwikala
mwikala / GenerateZiggyTypescriptDefinitionsCommand.php
Last active December 30, 2022 04:50
Generate Ziggy.js Typescript Definitions — Laravel 9 and Vite
// Copied from https://gist.github.com/iDevelopThings/aa0a288a4075371d875782c72f2c0389
// This command will generate a file in resources/js/ called ziggy-shims.d.ts
// Make sure to install @types/ziggy-js for the type definitions used by the file generated
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;