Skip to content

Instantly share code, notes, and snippets.

View alistaircol's full-sized avatar
🛑
Stuck at a breakpoint

Ally alistaircol

🛑
Stuck at a breakpoint
View GitHub Profile
<h1>Confirmation</h1>
@alistaircol
alistaircol / github-workflow-lint-test-laravel-private-package.yaml
Created September 5, 2022 14:58
GitHub Workflow - Laravel Unit Feature Test Private Repository Package Code Coverage Generation Artifact
---
name: GitHub Workflow - Laravel Unit Feature Test Private Repository Package Code Coverage Generation Artifact
on:
push:
branches:
- main
pull_request:
branches:
- main
<?php
namespace App\Charts\Generators;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use Spatie\TemporaryDirectory\TemporaryDirectory;
use Spatie\Browsershot\Browsershot;
use App\Models\Article;
use App\Models\Asset;
<?php
namespace App\Charts;
use Spatie\DataTransferObject\DataTransferObject;
use Illuminate\Support\Collection;
class HorizontalBarChart extends DataTransferObject
{
public const MEASUREMENT_RELATIVE = 'relative';
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Imgproxy\UrlBuilder;
@alistaircol
alistaircol / index.md
Last active April 6, 2022 08:28
Fuck Livewire

Some stupid annoying things I've encountered with Livewire.

In some code examples, imagine we are building some property management platform.

mount

Want to pass some nullable property? Is it a model? Well you better not type-hint it.

Wrong!:

@alistaircol
alistaircol / Dockerfile
Created July 7, 2021 19:39
Image with default tailwindcss tailwind config viewer multi-stage build exporting static output to be hosted by a caddy server
# build
# docker build --force-rm --tag=alistaircol/tcv .
# run
# docker run --rm -it -p 9999:80 alistaircol/tcv:latest
FROM node:16-alpine AS build
WORKDIR /usr/src/app
RUN npm install tailwindcss tailwind-config-viewer; \
npx tailwindcss init --jit --full; \
npx tailwind-config-viewer export tcv-out
@alistaircol
alistaircol / CommandListenerProvider.php
Created June 21, 2021 20:01
CommandListenerProvider
<?php
namespace App\Providers;
use Event;
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Support\ServiceProvider;
class CommandListenerProvider extends ServiceProvider
@alistaircol
alistaircol / docker-compose.yml
Created February 20, 2021 19:21
docker-compose.yml
# docker run --rm -v $(pwd):/data cytopia/yamlfmt -w docker-compose.yml
version: '3.4'
services:
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
minio:
@alistaircol
alistaircol / inputs.tf
Created February 20, 2021 18:23
Terraform: Graylog
resource "graylog_input" "syslog_udp" {
title = "syslog"
type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"
global = true
attributes = jsonencode({
bind_address = "0.0.0.0"
port = 514
recv_buffer_size = 262144
decompress_size_limit = 8388608