Skip to content

Instantly share code, notes, and snippets.

View atomjoy's full-sized avatar

Atomjoy atomjoy

View GitHub Profile
@atomjoy
atomjoy / Minimal-Html-Email.md
Created September 29, 2026 09:53
Minimal html email template.

Html email template

Minimal html email template.

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
@atomjoy
atomjoy / Vue-Table-State-Watcher.md
Created September 12, 2026 10:01
Vue table state watcher

Vue Table Filters Watcher

Globalny stan aplikacji w vue, inertia z przekazywaniem i aktualizacją stanu z komponentu.

Composable watcher

// composable/useTableWatcher.ts
import { watch, type Ref } from 'vue'
import { router } from '@inertiajs/vue3'
@atomjoy
atomjoy / Laravel-Vue-Inertia-TableState.md
Last active September 11, 2026 09:48
Reaktywny stan aplikacji w Vue Inertia.

Table State Laravel Vue Inertia

Reaktywny stan aplikacji w Vue Inertia.

Funkcje

// helpers/useHelpers.ts
import { Ref } from 'vue'
@atomjoy
atomjoy / Filterable.php
Created September 10, 2026 12:50
Laravel Filterable
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Schema;
trait Filterable
{
/**
@atomjoy
atomjoy / Tanctack-Vue-Table-v9.md
Last active September 4, 2026 15:55
Tanstack Inertia Laravel Vue

Tanstack v9 Vue Inertia

Table with sorting, pagination, text search.

Controller

public function index(Request $request){
	$query = User::query();
@atomjoy
atomjoy / Tanctack-Vue-Table-v9-useQuery-Api.md
Last active September 4, 2026 16:05
Tanstack table with vue-table, vue-query Laravel 13 Vue Inertia API.

Tanstack v9 useQuery v5 Laravel Inertia Vue

Laravel 13 Inertia, Vue i zapytania z useQuery do api.

Instalacja

npm i @tanstack/vue-table@9
npm i @tanstack/vue-query@5
@atomjoy
atomjoy / LaravelInertiaTable.md
Created September 4, 2026 09:32
Laravel Inertia table.

Laravel Inertia Table

Backend

<?php

namespace App\Http\Controllers;

use App\Models\Todo;
@atomjoy
atomjoy / Composable.md
Last active September 4, 2026 08:19
Composable przykłady

Composable

Możesz zaimportować useCounter w kilku różnych komponentach, a każdy z nich będzie miał swój własny, niezależny licznik. Cała logika licznika jest poza komponentem wizualnym.

Tworzenie

composable.ts

import { ref } from 'vue'
@atomjoy
atomjoy / TanstackUseQuery.md
Last active September 4, 2026 09:31
Tanstack query

Tanstack Query

TanStack Query (dawniej znany jako React Query) to potężna biblioteka do zarządzania asynchronicznym stanem aplikacji (tzw. server state). Pomaga w pobieraniu (fetching), cache'owaniu, synchronizowaniu oraz aktualizowaniu danych pochodzących z serwera, eliminując potrzebę pisania skomplikowanego kodu opartego na useEffect i useState.

Install

npm i @tanstack/vue-query
npm i @tanstack/vue-table
@atomjoy
atomjoy / PublicDirectoryProvider.php
Created September 2, 2026 15:11
PublicDirectoryProvider Laravel
<?php
// php artisan storage:link
namespace App\Providers;
use Carbon\CarbonImmutable;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;