This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request, Response, NextFunction } from "express"; | |
const app = express(); | |
/** | |
* Middleware to parse URL-encoded data | |
* v5 Change: No need to set `extended` to `false` explicitly, it's now the default | |
*/ | |
app.use(express.urlencoded()); // Default behavior parses simple key-value pairs in query strings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Consolidate all class definitions from app/Models into app/ConsolidatedModels.php | |
* Revised version with corrected class extraction to prevent duplicate 'class' keywords. | |
*/ | |
// Define the directories | |
$modelsDir = __DIR__ . '/app/Models'; | |
$outputFile = __DIR__ . '/app/ConsolidatedModels.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to update a firewall rule in a Hetzner Firewall with your current IP address. | |
# Good if you would like to restrict SSH access only for your current IP address (secure). | |
################# | |
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you | |
# added all the required rules. | |
# I use a separate firewall rule just for SSH access. | |
################# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Facades\Artisan; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Date; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
mailpit: | |
image: axllent/mailpit:latest | |
container_name: mailpit | |
ports: | |
- "8025:8025" # Web interface | |
- "1025:1025" # SMTP port | |
meilisearch: | |
image: getmeili/meilisearch:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Config } from 'tailwindcss'; | |
import plugin from 'tailwindcss/plugin'; | |
import chroma from 'chroma-js'; | |
const domainScale = [100, 200, 300, 400, 500, 600, 700, 800, 900]; | |
function generateShadesInverted(baseColor, steps = 9) { | |
const scale = chroma | |
.scale(['white', baseColor, 'black']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "fs"; | |
import chroma from "chroma-js"; | |
// Define your custom colors | |
const colors = { | |
primary: "#1E40AF", // Blue | |
secondary: "#10B981", // Green | |
tertiary: "#9333EA", // Purple | |
accent: "#F59E0B", // Amber | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------ | |
# FZF Configuration | |
# ------------------------------------------------------------------------------ | |
# Source fzf's key bindings and completion (if installed via Homebrew or similar) | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
# Adjust default FZF options (feel free to tweak) | |
export FZF_DEFAULT_OPTS="--height=70% --reverse --border" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"github.copilot.chat.commitMessageGeneration.instructions": [ | |
{ | |
"text": "Generate commit messages following the Conventional Commits specification. Use the following structure strictly:\n\n<type>[optional scope]: <short description>\n\nOptional body: Include a detailed explanation of the change if necessary. Wrap text at 72 characters per line.\n\nOptional footer: Include metadata such as issue references or breaking changes. Use keywords like 'BREAKING CHANGE:' followed by an explanation, and reference issues with 'Closes #<issue_number>'.\n\nTypes must be one of the following:\n- feat: For introducing new features.\n- fix: For bug fixes.\n- docs: For documentation-only changes.\n- style: For changes that do not affect code functionality (e.g., formatting).\n- refactor: For code changes that neither fix a bug nor add a feature.\n- test: For adding or modifying tests.\n- chore: For non-code tasks such as updating dependencies.\n\nThe short description must be imperative (e.g., 'add featu |