Skip to content

Instantly share code, notes, and snippets.

View geosem42's full-sized avatar

George geosem42

View GitHub Profile
@geosem42
geosem42 / app\Filament\Resources\UserResource.php
Last active December 19, 2024 20:36
Make table records seletacble in Filament Laravel
use App\Traits\HasResourcePermissions;
class UserResource extends Resource
{
public static function table(Table $table): Table
{
return $table
->columns([
//
])
@geosem42
geosem42 / recaptcha-v3.md
Last active August 29, 2025 01:46
Integrating Google ReCaptcha v3 in Laravel Jetstream with Inertia

This gist will guide you through the process of integrating Google ReCaptcha v3 into a Laravel Jetstream w/ Inertia application.

API Keys and Configuration

First, obtain your ReCaptcha v3 API keys from the Google ReCaptcha Admin Console. Add these keys to your .env file:

RECAPTCHA_SITE_KEY=your_site_key_here
RECAPTCHA_SECRET_KEY=your_secret_key_here

Next, update your config/services.php file to include the ReCaptcha configuration. This configuration allows us to access our ReCaptcha keys throughout the application using Laravel's config helper. It keeps our sensitive keys secure by referencing environment variables.

@geosem42
geosem42 / rename.py
Created August 10, 2023 20:30
Rename files in a directory if the filename includes an underscore, has a certain extension and replace it with a space
import os
def rename_files(directory):
for filename in os.listdir(directory):
if "_" in filename and filename.endswith(".mkv"):
new_filename = filename.replace("_", " ")
src = os.path.join(directory, filename)
dst = os.path.join(directory, new_filename)
os.rename(src, dst)