Skip to content

Instantly share code, notes, and snippets.

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

Kcko

🦜
fly like a bird ...
View GitHub Profile
<div class="grid">
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
@Kcko
Kcko / index.js
Last active October 11, 2024 07:32
// https://blog.stackademic.com/how-to-optimize-complex-conditionals-in-javascript-0fcaf0add82a
const onButtonClick = (status) => {
if (status == 1) {
jumpTo('Index Page');
} else if (status == 2 || status == 3) {
jumpTo('Failure Page');
} else if (status == 4) {
jumpTo('Success Page');
// 1 - composable
import { ref, computed, watchEffect } from 'vue';
import useSomeOtherComposable from './useSomeOtherComposable';
export default function useMyComposable() {
const { asyncValue1, asyncValue2 } = useSomeOtherComposable();
const resolved = ref(false);
// Hodnoty, které vrátíme, až budou splněny podmínky
@Kcko
Kcko / index.php
Last active October 8, 2024 07:35
<?php
// 1 config object
class FooConfig {
public int $param1 = 0;
public int $param2 = 0;
public string $param3 = '';
public string $param4 = '';
public bool $param5 = false;
public ?int $param6 = null;
<style>
grid {
border: 2px solid maroon;
width: 100%;
display: flex;
overflow: auto visible;
scrollbar-width: none;
}
document.addEventListener('DOMContentLoaded', () => {
let lazyImages = document.querySelectorAll('.lazyload');
let observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
let img = entry.target;
img.src = img.dataset.src;
observer.unobserve(img);
}
});
// Copied from https://javascript.plainenglish.io/structuredclone-the-easiest-way-to-deep-clone-objects-in-javascript-c503b536266b
const testData = {
number: 123,
string: "test",
undefined: undefined,
null: null,
boolean: true,
object: { a: 1, b: { c: 2 } },
array: [1, 2, { d: 3 }],
<aw-alert v-for="flash in {$control->getVueDataVar('flashes')}" :type="flash.type">{_}Je to správně? Zkuste číslo opsat ještě jednou.{/_}</aw-alert>
<template v-for="image in $presenter.voucher.photos" :key="image.id">
<aw-img src="/assets/temp/enjoyment-1.jpg" class="rounded-ambi" :image="image" size="1230x870x8" />
</template>
<div class="Filters justify-center">
<ambi-filter-tag
v-for="(filter, index) in $controls['filterTagsList'].filters"