Skip to content

Instantly share code, notes, and snippets.

@MACscr
MACscr / FilamentTableTabs.php
Last active September 26, 2023 04:23
Standalone Filament Table Tabs
<?php
# App\Http\Livewire\Traits\FilamentTableTabs
namespace App\Http\Livewire\Traits;
trait FilamentTableTabs
{
public ?string $activeTab = null;
@awcodes
awcodes / NowAction.php
Created August 18, 2023 21:19
NowAction
<?php
namespace ...
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Set;
class NowAction extends Action
{
@awcodes
awcodes / app.css
Created July 25, 2023 01:47
Filament v3 Custom Login
.fi-simple-main-ctn::before {
content: '';
position: absolute;
inset: 0;
opacity: 0.90;
background-image: radial-gradient(
circle at top,
theme('colors.primary.300'),
theme('colors.transparent'),
theme('colors.transparent') 100%
@laracasts
laracasts / modal.blade.php
Last active January 28, 2022 00:13
Modals with Zero JavaScript
<div id="{{ $name }}" class="overlay">
<a href="#" class="cancel"></a>
<div class="modal">
{{ $slot }}
<a href="#" class="close">&times;</a>
</div>
</div>
@stidges
stidges / tailwind.itermcolors
Last active November 30, 2023 21:00
An iTerm2 color scheme based on the Tailwind CSS color scheme (https://tailwindcss.com/docs/colors)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.17254902422428131</real>
@joseluisq
joseluisq / stash_dropped.md
Last active May 12, 2024 16:23
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@mazedlx
mazedlx / tailwindcss.blade.php
Created November 5, 2017 12:54
Tailwind CSS template for Laravel pagination
@if ($paginator->hasPages())
<div class="flex items-center">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<span class="rounded-l rounded-sm border border-brand-light px-3 py-2 cursor-not-allowed no-underline">&laquo;</span>
@else
<a
class="rounded-l rounded-sm border-t border-b border-l border-brand-light px-3 py-2 text-brand-dark hover:bg-brand-light no-underline"
href="{{ $paginator->previousPageUrl() }}"
rel="prev"
@psgganesh
psgganesh / README.md
Last active February 12, 2018 04:11
Use laravel / envoy for smoother deployments on forge servers

Adding envoy globally using

composer global require laravel/envoy

Update ~/.bashrc file to enable envoy on CLI

echo 'export PATH="$PATH:/home/forge/.config/composer/vendor/bin"' &gt;&gt; ~/.bashrc
@paulredmond
paulredmond / ValidateMailgunWebhook.php
Created April 24, 2017 21:55
Laravel Middleware to Validate a signed Mailgun webhook
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
/**
* Validate Mailgun Webhooks
* @see https://documentation.mailgun.com/user_manual.html#securing-webhooks
@nick-f
nick-f / laravel-spark-metrics-dummy-data.php
Created December 1, 2016 05:39
Generate random data for Laravel Spark metrics to show off the graphs
Route::get('/metricsdummy', function() {
for ($i = 0; $i < 100; $i++) {
DB::table('performance_indicators')->insert([
'monthly_recurring_revenue' => mt_rand(1000, 2000),
'yearly_recurring_revenue' => mt_rand(50000, 60000),
'daily_volume' => mt_rand(100, 300),
'new_users' => mt_rand(50, 100),
'created_at' => Carbon\Carbon::now()->subDays($i),
'updated_at' => Carbon\Carbon::now()->subDays($i),
]);