Skip to content

Instantly share code, notes, and snippets.

View Kcko's full-sized avatar
🦜
fly like a bird ...

Roman Janko Kcko

🦜
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / readme.php
Last active October 24, 2025 13:41
<?php
// ============================================================================
// FOTBALISTA - Entita
// ============================================================================
class Player
{
private string $name;
private int $age;
<?php
/**
 * ========================================
 * 📦 Další praktické OOP koncepty (krátce)
 * ========================================
 */

// ============================================================================
// 1. 📦 DTO (Data Transfer Objects) - Typované přenosy dat
<?php
/**
 * ========================================
 * 🔒 IMMUTABLE OBJECTS - Kompletní průvodce
 * ========================================
 */

// ============================================================================
// CO TO JE?
_
<!--
https://play.tailwindcss.com/V4B6tDWkg1
-->
<div class="[--color:red] md:[--color:green]">
<div class="aspect-square w-20 bg-[var(--color)]">1</div>
<div class="aspect-square w-20 bg-[--color]">2</div>
</div>
<?php
namespace App\Domain;
class Card
{
public CardSuit $suit;
public CardRank $rank;
public function __construct(CardSuit $suit, CardRank $rank)
@Kcko
Kcko / demo.css
Last active October 12, 2025 17:34
/* https://www.bitovi.com/blog/css-only-type-grinding-casting-tokens-into-useful-values */
@property --variant {
syntax: "primary|secondary|success|error";
initial-value: primary;
inherits: true;
}
@property --_v-primary-else-0 {
syntax: "primary|<integer>"; initial-value: 0; inherits: true;
@Kcko
Kcko / demo.html
Last active October 3, 2025 20:08
https://play.tailwindcss.com/jkUSFtwsv3
@Kcko
Kcko / tricks.js
Last active September 30, 2025 10:30
// https://medium.com/@ThinkingLoop/12-dom-tricks-no-libraries-required-61268e398c50
// 1) Query once, act many
const $ = (sel, root = document) => root.querySelector(sel);
const $$ = (sel, root = document) => [...root.querySelectorAll(sel)];
const app = $('#app');
const buttons = $$('.action', app);
buttons.forEach(btn => btn.addEventListener('click', onAction));
@Kcko
Kcko / layers.css
Last active September 19, 2025 06:43
/* 1. Define the order of all layers */
@layer reset, base, library, components, utilities, overrides;
/* 2. Place different styles into corresponding layers */
/* reset.css or normalize.css */
@layer reset {
/* ...reset the browser's default styles... */
* { box-sizing: border-box; }
}