Skip to content

Instantly share code, notes, and snippets.

View vedovelli's full-sized avatar
💭
🚀

Fábio Vedovelli vedovelli

💭
🚀
View GitHub Profile
@vedovelli
vedovelli / gist:686ee125f2da67bc8adb9295f7fe36d9
Created January 22, 2025 11:15
cursorrules-laravel-react
You are an expert in Laravel, Inertia.js, React and Tailwind CSS, with a strong emphasis on Laravel and PHP best practices.Key Principles- Write concise, technical responses with accurate PHP examples.- Follow Laravel best practices and conventions.- Use object-oriented programming with a focus on SOLID principles.- Prefer iteration and modularization over duplication.- Use descriptive variable and method names.- Favor dependency injection and service containers.PHP and Laravel Core- Use PHP 8.3+ features when appropriate (e.g., typed properties, match expressions).- Follow PSR-12 coding standards.- Use strict typing: declare(strict_types=1);- Utilize Laravel's built-in features and helpers when possible.- Follow Laravel's directory structure and naming conventions.- Use lowercase with dashes for directories (e.g., app/Http/Controllers).- Implement proper error handling and logging: - Use Laravel's exception handling and logging features. - Create custom exceptions when necessary. - Use try-catch blocks for e
@vedovelli
vedovelli / Instructions.MD
Created January 7, 2025 09:29 — forked from diogogpinto/Instructions.MD
Best Laravel AI Prompt to use with Claude

I have been utilizing artificial intelligence to enhance and optimize my codebases. After evaluating various models, applications, and editors, I find the claude.ai interface with a Pro Account to be the most effective. Here’s the approach I’ve developed to achieve optimal results:

This gist contains a carefully crafted prompt and a script designed to convert your entire Laravel codebase (excluding the resources folder, which can be easily added if needed) into a TXT file with the following structure:

<File Start: ./path/filename.extension> Content of file <End File: ./path/filename.extension>

To implement this method:

2gua.rainbow-brackets
adampalhazi.vscode-debug-arrow-function
alexcvzz.vscode-sqlite
alfnielsen.vsc-organize-imports
aliariff.auto-add-brackets
andys8.jest-snippets
antfu.iconify
antfu.vite
apollographql.vscode-apollo
arcticicestudio.nord-visual-studio-code
# Salvar num arquivo ~/encode.sh, conceder direito de execução e
# executar desta forma (adaptar nomes de diretórios e arquivos para seu caso):
# $ ~/encode.sh ~/Video/bigFile.mp4 ~/Video/smallFile.mp4
ffmpeg -i "$1" -vcodec h264 -acodec aac "$2"
@vedovelli
vedovelli / db.server.ts
Created September 23, 2022 18:37
Remix Prisma DB server
// @ts-nocheck
import { PrismaClient } from '@prisma/client';
let db: PrismaClient;
declare global {
let __db: PrismaClient | undefined;
}
// this is needed because in development we don't want to restart
{
"git.enableSmartCommit": true,
"workbench.editor.decorations.colors": true,
"editor.minimap.enabled": false,
"editor.accessibilitySupport": "off",
"zenMode.hideLineNumbers": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"tailwindCSS.includeLanguages": {
"typescriptreact": "html",
"plaintext": "html",
@vedovelli
vedovelli / deploy_app_laravel_digital_ocean
Last active February 10, 2023 18:55
Deploy app Laravel no Digital Ocean
1. Crie uma conta no Digital Ocean;
2. Crie um droplet Ubuntu (estas instruções são baseadas em Ubuntu)
3. Escolha o pacote LEMP para ser instalado com seu Ubuntu
4. Escolha ou associa sua chave publica para acesso ao servidor
5. Acesse seu server usando SSH (ssh root@<ip informado pelo DO>)
AxiosError: Request failed with status code 400
at settle (/Users/vedovelli/Shamrock/app-new/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (/Users/vedovelli/Shamrock/app-new/node_modules/axios/lib/adapters/http.js:505:11)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'ERR_BAD_REQUEST',
config: {
transitional: {
silentJSONParsing: true,
server {
listen 80;
server_name CHANGEME.app;
root /var/www/vhosts/CHANGEME.app/public;
index index.html index.htm index.php;
charset utf-8;
location / {
import type { LoaderFunction, ActionFunction } from "remix";
import { useLoaderData, useFetcher } from "remix";
import invariant from "tiny-invariant";
import cuid from "cuid";
import React from "react";
import type { Task, User } from "@prisma/client";
import { requireAuthSession } from "~/util/magic-auth";
import { ensureUserAccount } from "~/util/account";
import { placeCaretAtEnd } from "~/components/range";
import { getBacklog } from "~/models/backlog";