Skip to content

Instantly share code, notes, and snippets.

View DevShaded's full-sized avatar
💭
I may be slow to respond.

Fredrik DevShaded

💭
I may be slow to respond.
View GitHub Profile
=== foundation rules ===

Laravel Boost Guidelines

The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to ensure the best experience when building Laravel applications.

Foundational Context

This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions.

<?php
declare(strict_types=1);
namespace App\Http\Controllers\Reservations;
use App\Action\Reservation\CacheReservationAction;
use App\Action\Reservation\CreateReservationAction;
use App\Action\Reservation\DeleteReservationAction;
use App\Action\Reservation\GetReservationAction;
// Work in progress :D
/**
* Interactive CLI tool that finds speed cameras and average speed cameras (ATK-punkt & Streknings-ATK) near your location
* using the NVDB API, with directional filtering to show only cameras relevant to your travel direction.
*/
const axios = require('axios');
const readline = require('readline');
@DevShaded
DevShaded / generateLargePDFContract.js
Created March 20, 2025 09:21
This code generate a pdf contract around 240+ pages. You can adjust the pages generated in the generateFullContract function.
const fs = require('fs');
const PDFDocument = require('pdfkit');
// Contract sections and templates
const contractSections = {
title: "MASTER SERVICES AGREEMENT",
parties: [
"This Agreement is made and entered into as of [DATE] by and between:",
"COMPANY NAME: [COMPANY]",
"ADDRESS: [ADDRESS]",
<div class="flex h-screen items-center justify-center bg-gray-300">
<div class="flex items-center rounded-lg border-2 border-black bg-white shadow-md">
<div class="ltr">
<div class="flex w-20 items-center justify-center rounded-s-lg bg-blue-600 p-6 text-white">
<div class="text-center">
<div class="relative mx-auto mb-3 h-9 w-10">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 22 16">
<rect width="22" height="16" fill="#ba0c2f" />
<path d="M0,8h22M8,0v16" stroke="#fff" stroke-width="4" />
<path d="M0,8h22M8,0v16" stroke="#2563EB" stroke-width="2" />
<?php
declare(strict_types=1);
namespace App\Services;
/**
* Representerer en kryptovaluta-transaksjon
*/
readonly class Transaction
# Innføring i Markdown
Markdown er et enkelt markeringsspråk som gjør det lett å formatere tekst for nettsider, dokumentasjon, eller notater. Det brukes mye på plattformer som GitHub, Reddit, og i mange dokumentasjonsverktøy. Her er en oversikt over grunnleggende funksjoner i Markdown.
## 1. Overskrifter
Bruk `#` for å lage overskrifter. Antall `#` bestemmer nivået på overskriften.
# Overskrift nivå 1
## Overskrift nivå 2
setTimeout(() => {
const bigTitleStyle = "font-size: 35px; color: #ff0000; font-weight: bold;";
const titleStyle = "font-size: 30px; color: #ff0000; font-weight: bold;";
const descriptionStyle = "font-size: 18px";
console.log("%c👋 Velkommen til Konsollens Gang!", bigTitleStyle);
console.log("%cLiker du å være i konsollen? Det gjør vi også. Kom og snakk med oss da vel?\nJoin https://discord.gg/vgno.", descriptionStyle);
console.log("%c🤔 Lyst til å bli lærling hos oss?", titleStyle);
console.log("%cSøk her: https://emp.jobylon.com/jobs/180192-vg-soknad-til-laerlingplass-i-vge24/", descriptionStyle);
console.log("%c🤗 Eller kanskje bare en vanlig jobb?", titleStyle);
@DevShaded
DevShaded / ttt.js
Last active August 16, 2023 11:09
Tic Tac Toe Game made in js
var Game = function(eventhub) {
let playerId = Math.random().toString(16).substr(2);
let gameId = null;
let gameLock = true;
let players = ['❌', '⭕️'];
let currentPlayer = players[1];
let state = [['❔','❔','❔'], ['❔','❔','❔'], ['❔','❔','❔']];
@DevShaded
DevShaded / console-enhancer.js
Created August 16, 2023 10:44
VG Error and Warning Handeling
const originalConsoleError = console.error;
const originalConsoleWarn = console.warn;
let devMode = false;
const oldErrors = [];
const oldWarns = [];
function consoleResponse() {
const bigTitleStyle = "font-size: 35px; color: #ff0000; font-weight: bold;";
const titleStyle = "font-size: 30px; color: #ff0000; font-weight: bold;";
const descriptionStyle = "font-size: 18px";