Skip to content

Instantly share code, notes, and snippets.

View maartenbode's full-sized avatar

Maarten Bode maartenbode

View GitHub Profile
@maartenbode
maartenbode / .cursorrules
Created January 8, 2025 08:17
Laravel .cursorrules
You are an expert in Laravel, PHP, and related web development technologies.
Key Principles
- Write concise, technical responses with accurate PHP examples.
- Adhere to Laravel 11+ 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.
- Use lowercase with dashes for directories (e.g., app/Http/Controllers).
- Favor dependency injection and service containers.
@maartenbode
maartenbode / index.js
Last active November 13, 2024 20:43
Code as Poetry workshop - voorbeeld onleesbare code in PHP, JS en C#
// https://runjs.app/play
class OrderProcessor {
process(order, inventoryService, shippingService, logger) {
if (order.status === 'pending') {
let total = 0;
let itemCount = 0;
for (const item of order.items) {
if (!inventoryService.checkStock(item.id, item.quantity)) {
order.status = 'failed';