Skip to content

Instantly share code, notes, and snippets.

View atomjoy's full-sized avatar

Atomjoy atomjoy

View GitHub Profile
@atomjoy
atomjoy / Google_Cookie_Consent_Button.html
Last active August 10, 2026 12:32
Google minimal cookie consent buttons.
@atomjoy
atomjoy / Splide-Marquee-Infinity-Scroll.md
Last active August 4, 2026 16:19
Splide.js - Marquee Infinity Effect.

Splide.js - Marquee Infinity Scroll Effect

<!DOCTYPE html>
<html lang="pl">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Splide Slider - Marquee Infinity Effect</title>
@atomjoy
atomjoy / Splide-Scale-Image.md
Last active August 4, 2026 15:40
Splide.js - Scale Image Effect with siblings.

Splide.js - Scale Image Effect

<!DOCTYPE html>
<html lang="pl">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Splide Slider - Efekt Skalowania Zdjęć</title>
@atomjoy
atomjoy / Csp-Spatie.md
Last active July 31, 2026 12:00
Przykłady polityki CSP w Laravel.

Csp Spatie

Proste przykłady polityki CSP w Laravel.

AppSmartPolicy

<?php

namespace App\Support\Csp;
@atomjoy
atomjoy / GTM.md
Last active July 28, 2026 18:26
GTM Custom cookie_domain for subdomain

Konfiguracja cookie dla subdomen jako parametr w GTM

Instrukcja krok po kroku, jak ustawić parametr cookie_domain bezpośrednio w panelu Google Tag Manager dla Tagu Google w (GA4). Dzięki temu rozwiązaniu wszystkie pliki cookie tworzone automatycznie przez skrypty Google (np. _ga, _gid) będą zapisywane na poziomie subdomeny lub domeny bez współdzielenia (podobno). Utwórz 2 konta w gtm dla domeny i subdomeny.

Krok 1: Otwórz Tag Google

  1. Zaloguj się do Google Tag Manager.
  2. W menu po lewej stronie przejdź do sekcji Tagi (Tags).
  3. Kliknij w swój istniejący Tag Google (Google Tag), który uruchamia analitykę na stronie.
@atomjoy
atomjoy / eval.blade.php
Created July 26, 2026 16:47
Call js function from string.
@props([
'functionName' => 'callMe2',
])
<script>
// Create function
function callMe1() {
alert('Wow1')
}
@atomjoy
atomjoy / gtag-banner.blade.php
Last active July 25, 2026 23:38
Google gtag consent cookie banner in Laravel blabe component.
<!-- Add in views/components/gtag-banner.blade.php -->
<!-- Komponent ładuje się na samej górze sekcji head -->
{{-- <x-gtag-banner gtm-id="GTM-XXXXXXX" /> --}}
{{-- @include('components.gtag-banner', ['gtmId' => 'GTM-XXXXXXX']) --}}
<!-- Button wywołujący cookie banner dodaj do sekcji footer -->
{{-- <button type="button" class="cookie-trigger-btn" onclick="showCookieBanner()">Ustawienia Cookies</button> --}}
<!-- CONSENT COOKIE BANNER BLADE COMPONENT -->
@atomjoy
atomjoy / GoogleTagManagerEvents.md
Last active July 25, 2026 23:18
Gtag manager js events

Google TagManager Custom Events

Trigger events in gtag manager from js.

Add events

const payload = {
    order: {
        id: 1,
@atomjoy
atomjoy / WatermarkImage.php
Last active June 3, 2026 08:59
Laravel Intervention text watermark on image with custom font.
<?php
namespace App\Actions\Website;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Typography\Font;
@atomjoy
atomjoy / Shiki-Vite-Chunks.md
Created May 26, 2026 18:39
Vite Shiki highlighter chunks in Laravel 13, Vue3, Inertia (no warnings).

Vite shiki chunks in Laravel 13, Vue3, Inertia (no warnings)

import inertia from '@inertiajs/vite';
import { wayfinder } from '@laravel/vite-plugin-wayfinder';
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import laravel from 'laravel-vite-plugin';
import { defineConfig } from 'vite';