Skip to content

Instantly share code, notes, and snippets.

View edeoliv's full-sized avatar
:octocat:

Elias Olivtradet edeoliv

:octocat:
View GitHub Profile
@edeoliv
edeoliv / AppServiceProvider.php
Created June 27, 2025 11:36
Toggle with modal confirmation
<?php
....
//In your boot method on Service Provider or custom method add
Toggle::macro('registerDynamicActions', function (
@edeoliv
edeoliv / EditCustomMediaPropertyAction.php
Created May 26, 2025 06:51 — forked from afsakar/EditCustomMediaPropertyAction.php
Edit custom properties action for SpatieMediaLibraryFileUpload component
<?php
namespace App\Filament\Actions;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Closure;
use Filament\Forms;
use Filament\Notifications\Notification;
use Illuminate\Support\HtmlString;
@edeoliv
edeoliv / nif-pt.js
Created April 11, 2025 23:16 — forked from aguinaldotupy/nif-pt.js
Validação de NIF Portugal com Javascript
/*
Source: http://www.portugal-a-programar.pt/topic/58852-algoritmo-de-validacao-de-nif-pt/
*/
function validaContribuinte(contribuinte){
// algoritmo de validação do NIF de acordo com
// http://pt.wikipedia.org/wiki/N%C3%BAmero_de_identifica%C3%A7%C3%A3o_fiscal
var temErro=0;
@edeoliv
edeoliv / .env
Created April 11, 2025 23:15 — forked from aguinaldotupy/.env
Docker Laravel Octane / PHP 8.4 / Swoole
OCTANE_SERVER="swoole"
OCTANE_HTTPS="true"
WWWGROUP=1004
WWWUSER=1004
@import '/vendor/filament/filament/resources/css/theme.css';
@config 'tailwind.config.js';
body {
/* @apply !bg-primary-50 dark:!bg-gray-950;*/
}
.fi-sidebar {
/* @apply bg-white border-r shadow-sm p-4 !important; */
@import '/vendor/filament/filament/resources/css/theme.css';
@config 'tailwind.config.js';
html:not(:has(.fi-topbar-with-navigation)) {
.fi-sidebar,
.fi-sidebar-header,
aside {
@apply !ring-0 !shadow-none;
}
@edeoliv
edeoliv / git-ssh-error-fix.sh
Created March 1, 2025 16:48 — forked from joaopaulolndev/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
<?php
namespace App\Support;
use Exception;
abstract class QRCodePixSupport
{
/**
* @throws Exception
@edeoliv
edeoliv / Remember.php
Created November 2, 2024 14:42 — forked from renatofrota/Remember.php
Remember: a simple Laravel / PHP volatile runtime cache
<?php
// save this file as ./app/Helpers/Remember.php
namespace App\Helpers {
class Remember
{
public static array $that = [];
}
@edeoliv
edeoliv / MaxUploadSizeService.php
Created September 7, 2024 02:10 — forked from cursosdesarrolloweb/MaxUploadSizeService.php
Get the max upload size from desired and php.ini config with Laravel
<?php
namespace App\Services;
use Exception;
use Illuminate\Http\UploadedFile;
final class MaxUploadSizeService
{
const BYTES = 'B';