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 / index.php
Last active November 28, 2025 09:50
<?php
$regex1 = '/(\d+) \1/'; // Backreference
$regex2 = '/(\d+) (?1)/'; // Subroutine
100 100 // ✅ only backreference
100 200 // ✅ both!
// https://github.com/Hamz-a/php-regex-best-practices/blob/master/07%20Writing%20modular%20regexes.md
// useFormHandler.js
import { ref } from 'vue'
export function useFormHandler(initialData = {}) {
const formData = ref({ ...initialData })
const errors = ref({})
const validate = () => {
errors.value = {}
Object.keys(formData.value).forEach(key => {
if (!formData.value[key]) errors.value[key] = 'Required'
https://jsbin.com/qonusuciru/6/edit?html,css,output
_
@Kcko
Kcko / demo.txt
Last active November 7, 2025 08:55
https://jsbin.com/hegesunoyu/3/edit?html,css,output
@Kcko
Kcko / demo.txt
Last active November 26, 2025 08:52
/* [1] Card List */
https://codepen.io/kevinpowell/pen/RwvWoLg
/* [2] Two list side by side with unlimited rows and same height on each row */
https://codepen.io/kevinpowell/pen/KKqjrRO
@Kcko
Kcko / index.html
Last active November 5, 2025 15:20
<!-- https://codepen.io/gwaradon/pen/poYYbPY -->
<div class="w-500">
<div class="grid">
<div class="grid-item">
Gird item 1
</div>
<div class="grid-item">
Gird item 2
@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