Skip to content

Instantly share code, notes, and snippets.

View Gummibeer's full-sized avatar
🐼
beary busy

Tom Herrmann Gummibeer

🐼
beary busy
View GitHub Profile
<?php
namespace App\PHPStan\Rules;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
<?php
namespace App\Exceptions;
use ArrayIterator;
use Closure;
use Countable;
use Exception;
use Illuminate\Support\Collection;
use IteratorAggregate;
<?php
namespace Tests\Asserts;
use App\Domain\Stock\Enum\StocktakingStatus;
use App\Domain\Stock\Resource\StorageBatchResource;
use Carbon\Carbon;
use DateTimeInterface;
use Illuminate\Testing\Fluent\AssertableJson;
use OutOfBoundsException;
<?php
function number2words(int $number): string
{
if ($number < 20) {
return ones2words($number);
} elseif ($number < 100) {
return tens2words($number);
} elseif ($number < 1000) {
return hundreds2words($number);
<?php
namespace JustSteveKing\Transporter;
use Illuminate\Http\Client\PendingRequest;
class CreateTodoRequest extends Request
{
protected string $method = 'POST';
protected string $baseUrl = 'https://jsonplaceholder.typicode.com';
<?php
namespace App\Eloquent\Concerns;
use Illuminate\Database\Eloquent\Model as IlluminateModel;
use Illuminate\Support\Arr;
use Vinkla\Hashids\Facades\Hashids;
trait HasHashId
{
import {registerRoute} from 'workbox-routing';
import {StaleWhileRevalidate} from 'workbox-strategies';
import {CacheableResponsePlugin} from 'workbox-cacheable-response';
import {CacheFirst} from 'workbox-strategies';
import {ExpirationPlugin} from 'workbox-expiration';
self.addEventListener("message", (event) => {
if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting();
}
# clear system caches
sudo rm -rf /Library/Caches/*
sudo rm -rf /System/Library/Caches/*
sudo rm -rf ~/Library/Caches/*
# clear dns cache
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
# clear google chrome cache
<?php /** @var Illuminate\View\ComponentAttributeBag $attributes */ ?>
<?php /** @var Illuminate\Support\HtmlString $slot */ ?>
<?php /** @var int $delay */ ?>
<?php /** @var string $callback */ ?>
<div x-data="abortableButton()" x-init="delay = {{ $delay ?? 5000 }}; callback = () => { {{ $callback }} };" class="w-1/2">
<template x-if="!clicked">
<button
type="button"
class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded w-full"