Skip to content

Instantly share code, notes, and snippets.

beary busy

Tom Witkowski Gummibeer

beary busy
View GitHub Profile
# 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
View sort_ips.php
class IpAddress
public string $ip;
public function __construct(string $ip)
$this->ip = $ip;
public function __toString(): string
Gummibeer / SignInController.php
Last active Sep 2, 2020
Laravel ThrottlesRequests trait
View SignInController.php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Concerns\ThrottlesRequests;
use App\Http\Requests\Auth\SignInRequest;
use App\Http\Requests\Auth\SignUpRequest;
use App\Models\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\RedirectResponse;
View abortable-button.blade.php
<?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">
class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded w-full"
Gummibeer / TestCase.php
Last active Mar 21, 2020
phpunit testcase auto setup/teardown traits
View TestCase.php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use JMac\Testing\Traits\HttpTestAssertions;
use Tests\Utils\CreateUploadedFileFromFilePath;
use Tests\Utils\IsRoutesAware;
use Tests\Utils\ResourceAsserts;
Gummibeer / Car.php
Last active Jan 8, 2020
Car-User-Role permission scratch
View Car.php
class Car extends Model
public function users()
return $this->belongsToMany(User::class, 'car_user_role')
->withPivot('role_id', 'user_id', 'car_id');
Gummibeer / app__Http__Middleware__Localized.php
Created Oct 8, 2019
set all locales if app locale changes
View app__Http__Middleware__Localized.php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class Localized
Gummibeer / index.html
Last active Sep 10, 2019
Tailwind Admin Dashboard Template
View index.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Tailwind Admin Dashboard</title>
<link href="^1.0/dist/tailwind.min.css" rel="stylesheet">
Gummibeer /
Created Sep 5, 2019 — forked from Vestride/
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
Gummibeer / app-Libs-Formatter.php
Created Aug 10, 2019
float & date formatting of model attributes (- are folder separators)
View app-Libs-Formatter.php
namespace App\Libs;
use DateTime;
class Formatter
public static function float(float $float, int $decimals = 2): string